spray / spray-json

A lightweight, clean and simple JSON implementation in Scala
Apache License 2.0
969 stars 190 forks source link

Provide jsonFormatN method overloads #310

Closed jrudolph closed 5 years ago

jrudolph commented 5 years ago

That's instead of the numbered generated jsonFormat1, jsonFormat2, etc. because those will be much easier to use if you want to add or remove fields.

Not sure why this wasn't done like this from the beginning. Maybe overloading was improved since back then?

sirthias commented 5 years ago

There was a reason back then, which caused problems with the overloads. Maybe some post-erasure method signature collision? I don't remember.

Let's see if there are issues creeping up now...

jrudolph commented 5 years ago

There was a reason back then, which caused problems with the overloads. Maybe some post-erasure method signature collision? I don't remember.

See #311, maybe it was the issue that you always have to write jsonFormatN(X.apply _) instead of jsonFormat13(X) which works if X has no companion object.

sirthias commented 5 years ago

Yeah, that might have been it.

jrudolph commented 5 years ago

Done in #311.