-
Notifications
You must be signed in to change notification settings - Fork 148
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
serialize option None field on a object as json null #1085
Comments
@wenhoujx , could you explain the use case further? Usage of |
@Andrapyre hi, i am not trying to use encoding: Option None -> json null it's a good idea to not encoding json |
we figured out we can use implicit codec, however this doesn't work for zio-json 0.2.0-M4, works on zio-json 0.6.2. 0.2.0-M4 is the last version for zio 1 ? is that LTS? if so i think there is a bug.
|
/bounty $100 for making it configurable in some nice and consistent way. |
💎 $100 bounty • ZIOSteps to solve:
Thank you for contributing to zio/zio-json! Add a bounty • Share on socials
|
💡 @987Nabil submitted a pull request that claims the bounty. You can visit your bounty board to reward. |
🎉🎈 @987Nabil has been awarded $100! 🎈🎊 |
hello i found closed ticket #70 which concludes with "None fields on an object is dropped", however my use case actually asks for those
null
to be present.For example, the following test fails.
I wonder if there is a way to configure the
null
encoding behavior. 🙏btw, i also found #638, which has a
OptionAsJsonNull
wrapper. But i don't control all of the classes to be JSON serialized, so i don't think this wrapper helps me.The text was updated successfully, but these errors were encountered: