我有以下定义的Read:
当我验证这些数据时,我会得到以下错误提示:
我有以下定义的Read:
import org.joda.time.DateTime;
implicit val userInfoRead: Reads[UserInfo] = (
(JsPath \ "userName").readNullable[String] and
] (JsPath \ "startDate").readNullable[DateTime]
(UserInfo.apply _)
传入以下JSON对象:
"userInfo" : {
"userName": "joeuser",
"startDate": "2006-02-28"
}
当我验证这些数据时,我会得到以下错误提示:
(/startDate,List(ValidationError(validate.error.expected.jodadate.format,WrappedArray(yyyy-MM-dd))))))
你对格式中缺少了什么有什么建议吗?
]
,那个应该在那里吗? - Electric Coffee