I was originally getting this error;
[error] /Users/gavinbaumanis/workspace/intro/app/models/AppConfig.scala:10: No implicit format for models.NormalUser available.
[error] implicit val AppConfigFormat = Json.format[AppConfig]
and after some reading added in the following line;
implicit val NormalUserFormat = Json.format[NormalUser]
prior to the exisiting implicit declaration - which now gives me a new error that I just don't understand.
(also - while the error message is completely different, now, I don;t know if I have actually solved the original issue)
[error] /Users/gavinbaumanis/workspace/scribble/app/models/AppConfig.scala:8: No unapply or unapplySeq function found
[error] implicit val NormalUserFormat = Json.format[NormalUser]
val AppConfigForm: Form[CreateAppConfigForm] = Form {
mapping(
"blogtitle" -> nonEmptyText,
...
mapping(
"modifiedBy.firstName" -> text
)(ModifiedByForm.apply)(ModifiedByForm.unapply)
)(CreateAppConfigForm.apply)(CreateAppConfigForm.unapply)
}//End AppConfigForm
val AppConfigForm: Form[CreateAppConfigForm] = Form {
mapping(
"blogtitle" -> nonEmptyText,
...
"modifiedBy" -> mapping(
"firstName" -> text
)(ModifiedByForm.apply)(ModifiedByForm.unapply)
)(CreateAppConfigForm.apply)(CreateAppConfigForm.unapply)
}//End AppConfigForm
I am not even sure how I got to the first version of the code.
I obviously copied it from somewhere... but the Play 2.4 docs are actually pretty clear on the correct syntax...
Anyhow - all is well that ends well!
-Gavin.