Open mirelon opened 3 years ago
The output contains JSON serialization using play-json library, which is limited to case classes with 22 fields:
implicit lazy val myModelJsonFormat: Format[MyModel] = Json.format[MyModel]
If the case class MyModel has more than 22 fields, the code does not compile:
No unapply or unapplySeq function found for class MyModel: <none> / <none> implicit lazy val myModelJsonFormat: Format[MyModel] = Json.format[MyModel]
As the issue does not seem to be handled in Play (https://github.com/playframework/play-json/issues/3), I suggest using Jsonx (ai.x.play.json.Jsonx.formatCaseClass[MyModel]) for serialization of case classes with more than 22 fields like in this SO answer: https://stackoverflow.com/a/57317220/1878731
ai.x.play.json.Jsonx.formatCaseClass[MyModel]
This is a known bug with with case classes with 22+ variables: https://blog.datumbrain.com/2018/10/22/json-format-more-than-22-case-class.html
The output contains JSON serialization using play-json library, which is limited to case classes with 22 fields:
If the case class MyModel has more than 22 fields, the code does not compile:
As the issue does not seem to be handled in Play (https://github.com/playframework/play-json/issues/3), I suggest using Jsonx (
ai.x.play.json.Jsonx.formatCaseClass[MyModel]
) for serialization of case classes with more than 22 fields like in this SO answer: https://stackoverflow.com/a/57317220/1878731