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

Unable to omit null fields in avro JSON serialization if default value is also null #3159

Open
harshaspace opened this issue Jun 25, 2024 · 3 comments

Comments

@harshaspace
Copy link

harshaspace commented Jun 25, 2024

Hello,

Can we have an option to omit null fields from the JSON provided that the default value is also null ?
It helps to reduce the size of the JSON file and also consumer side will not affect with this kind of behaviour.

For instance, JSON serializers like Jackson, gson already have a similar feature to ignore null fields. (@JsonInclude(Include.NON_NULL))

Thanks!

@harshaspace
Copy link
Author

I found similar feature ticket in apache avro project, not sure how does it apply to confluent: https://issues.apache.org/jira/browse/AVRO-1582

@rayokota
Copy link
Member

You can annotate your POJO with @JsonInclude(Include.NON_NULL)

@harshaspace
Copy link
Author

@rayokota
This didn't help as it uses avro serialization.
These are I think Jackson annotations

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

No branches or pull requests

2 participants