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

how to filter the 'null' in MarshalJSON()? #183

Open
Cyberpunk314 opened this issue Mar 11, 2022 · 1 comment
Open

how to filter the 'null' in MarshalJSON()? #183

Cyberpunk314 opened this issue Mar 11, 2022 · 1 comment

Comments

@Cyberpunk314
Copy link

for example, there is a result for MarshalJSON() function.

{"bucket":{"int":0},"buckets":null,"docid":null}

I want to filter the 'null' in this case.

@actgardner
Copy link
Owner

@Cyberpunk314 You want to encode the record as JSON but you want to omit the empty fields? This library generates structs that serialize to JSON according to the Avro spec, which means the MarshalJSON method includes null fields.

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