Skip to content
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

Add support for serialize_nulls build config option #403

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

twklessor
Copy link

@twklessor twklessor commented May 31, 2023

Add support for serialize_nulls build config option. This option will enable that null fields are always serialized as null.

@knaeckeKami
Copy link
Collaborator

Thanks! I'll take a look at it soon.

@knaeckeKami
Copy link
Collaborator

So, to get on the same page:

You want a feature that always includes all null values when serialization, right?

Afaik this can be done in a much more simple way by just adding

@BuiltValueSerializer(serializeNulls: true)

as an annotation to the serializer, no custom serializer is needed for that. The Custom Serializer was needed to have the distinction between absent and null values.

@twklessor
Copy link
Author

Yes that's right. I almost expected you to have an easier solution. To be honest I used the work you'd already done in the branch with the Value wrapper concept.

@twklessor
Copy link
Author

Sorry to come back months later but what is the status of this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants