是json响应,
{
"enrollment_terms": [
{
"end_at": null,
"id": 1,
"name": "Default Term",
"start_at": null,
"workflow_state": "active",
"sis_term_id": null
}
]
}
//响应案例类
case class AccountTerms(enrollment_terms: List[enrollmentTerms])
case class enrollmentTerms(end_at: String, id: String, name: String, start_at: String, workflow_state: String, sis_term_id: String)
// Scala代码:
val accountTerm = json.extract[AccountTerms]
//线路错误
val terms = accountTerm.enrollment_terms
// 错误:加载类文件“AccountTerms.class”时检测到缺失或无效的依赖项。
无法访问com.abc.pqr.jobs包中的类型enrollmentTerms,
因为它(或其依赖项)缺失。检查您的构建定义
缺少或冲突的依赖项。 (重新运行-Ylog-classpath
以查看有问题的类路径。)
如果'AccountTerms.class'是针对com.abc.pqr.jobs的不兼容版本编译的,则完全重建可能会有所帮助