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
Encoder should remove None: Option[T] values #584
Comments
@mikaelstaldal you should just use a custom |
Ah, that works. But it seems like This is also something that is missing from documentation. |
yes, it's false :) I made a mistake and fixed the comment afterwards |
What was the reason to make |
I commented on this elsewhere, so a quick repeat: My take is that the printer should not modify the actual JSON format. This is something each |
Could nested options be interpreted differently? For |
I agree that I think the encoder, though, should drop Similar to |
Now that we have dropNullValues on both the printer and Json I think we can close this. |
It would be nice if the Encoder would remove the key/value completely when the type is
Option[T]
and the value isNone
. Currently, it encodes None to JSON null.(Json4s works this way.)
This code:
currently prints:
I would like it to be:
The text was updated successfully, but these errors were encountered: