Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Implement support for > 22 field case classes in macros #3
(Moved from playframework/playframework#3174)
In Scala 2.11, a case class can have more than 22 fields. We could modify our existing macros to support these. Here's approximately how to do it:
Then we should be able to support case classes with 484 parameters. I don't know if it's possible to create such a thing, since I think there's a 255 parameter limit for methods.
referenced this issue
Dec 12, 2016
We actually already support most of the features there (tuples, default values, sealed traits). I suspect we probably just want to rewrite the Json macro to use the logic used in play-json-extensions.
We don't have any current plans to work on this but we're happy to accept pull requests.
I also think this could improve performance. The way we're doing it now uses the functional syntax to "build" the serializer, which creates a lot of extra function calls and objects. The more direct style used in play-json-extensions would likely perform better.