-
Notifications
You must be signed in to change notification settings - Fork 162
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
Get default value from case class default paramters #552
Comments
/bounty $150 |
💎 $150 bounty created by jdegoes
|
From what I see schema does not have notion of default values for case classes. To keep it as generic as possible I guess something like that should be added (+ support for custom deserializers like json)? |
But Schema[T] is the only thing json codec can get from schema. |
We already have an annotation that can be used by a user to add a default value to a case class field. I think we should reuse that, and, in the Scala 2/3 macros, we see if a parameter to a case class constructor has a default value, and if so, we bundle that up and add the annotation to the This way, users of a |
Create instance of class can't make use of annotations. |
I'll /attempt #552 since this this is also useful for OpenAPI gen in zio-http. |
💡 @987Nabil submitted a pull request that claims the bounty. You can visit your org dashboard to reward. |
🎉🎈 @987Nabil has been awarded $150! 🎈🎊 |
It's very convenient to define default value in case class, and zio-json do so.
The text was updated successfully, but these errors were encountered: