-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add a codec annotation to mark a sealed trait as having all case object members #506
Comments
Maybe |
/bounty $75 |
|
Weird, when working with JSON parser recently I swore I've seen code like that - if everything is sealed trait is CaseObject0 it deserialises as single string. I'll take a look later. |
/attempt #506 |
💡 @pablf submitted a pull request that claims the bounty. You can visit your org dashboard to reward. |
🎉🎈 @pablf has been awarded $75! 🎈🎊 |
in zio-dynamodb (which is uses zio-schema) we have the
@enumOfCaseObjects
trait level annotation to signify that all members as case objects. This gets read by our codec generation code to produce a more compact encoding that is used in many legacy databases.eg given this model:
The default tagged union encoding is something like:
after you add the annotation to the sealed trait, the encoding is more compact, with one less level of indirection:
This issue is related to this one Define a canonical set of annotations that can be applied to sealed traits, case classes, and fields
The text was updated successfully, but these errors were encountered: