You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following the discussion on this Reddit thread, it would be nice if it was supported OOB by play-json. I'm copying the relevant part of the thread here.
From @SnooDogs8860:
In Scala 2.13, and play-json, I used the following pattern to serialize/de-serialize between case classes and Json:
defining implicit formatin the companion object of the case class, made it easily visible from outside, so the following code worked without > even requiring an extra import:
In Scala 3 I saw the type class derivation feature and though I could take advantage of it by a. making the code more compact. b. defining such a default formatting only once in a generic way in the type class.
From @mkatrenik and @SnooDogs8860, the implementation could like the following (using another custom trait as modifying the PlayJSON one was not possible):
It might only be a matter of opening a PR with the code above, I don't know how much changes would be required in play-json code to integrate it. I guess most of the "issue" is to have it only for Scala 3 and avoiding duplication of having a source file for Scala 2 and one for Scala3?
The text was updated successfully, but these errors were encountered:
This is a feature request, not an issue.
Following the discussion on this Reddit thread, it would be nice if it was supported OOB by play-json. I'm copying the relevant part of the thread here.
From @SnooDogs8860:
From @mkatrenik and @SnooDogs8860, the implementation could like the following (using another custom
trait
as modifying the PlayJSON one was not possible):It might only be a matter of opening a PR with the code above, I don't know how much changes would be required in play-json code to integrate it. I guess most of the "issue" is to have it only for Scala 3 and avoiding duplication of having a source file for Scala 2 and one for Scala3?
The text was updated successfully, but these errors were encountered: