-
Notifications
You must be signed in to change notification settings - Fork 410
How to exclude field from toJson serialization? #1100
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I'd actually like the above and one step further.. I have a backend SQL database that on Inserts has some Not Null with default database fields. So whilst I'm using this solution, toJson converts to a null value as it should when it's a nullable field, but if it's null on the data side I'd like to exclude the field in the toJson.. |
Duplicate of #569 Trying to align all of these requests into one place! |
I have a (draft) PR out on this. I'd LOVE (early) feedback about if this works for what folks need here: #1256 I still need to do some documentation and testing... |
@JulianSwales – please open a separate issue for your request! |
Hi
Currently
JsonKey
annotation haveignore
parameter, but it's generalized for bothfromJson
andtoJson
.The idea is to have a control over which fields can be serialized via
toJson
method and then sent over internet.Could there be implemented additional parameter
bool? excludeToJson
?The text was updated successfully, but these errors were encountered: