zio / zio-json

Fast, secure JSON library with tight ZIO integration.
https://zio.dev/zio-json
Apache License 2.0
401 stars 143 forks source link

Type hint transformation for sealed hierarchies #1093

Closed vladimirkl closed 2 months ago

vladimirkl commented 2 months ago

Hi, this PR adds support for transforming type hint values in sealed hierarchies using same approach as for @jsonMemberNames - via new annotation @jsonHintNames for sealed class / trait. This approach looks more maintainable than individual @jsonHint for each descendent, especially when supporting some naming convention in large hierarchy. I also noticed similar feature request in discord, so I hope this PR will be useful not only for me: https://discord.com/channels/629491597070827530/733728086637412422/1221797252432007290