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

Nullable schema incorrect serialization #3

Open
shaeqahmed opened this issue Sep 3, 2022 · 0 comments
Open

Nullable schema incorrect serialization #3

shaeqahmed opened this issue Sep 3, 2022 · 0 comments

Comments

@shaeqahmed
Copy link

According to the avro spec, nullable fields in a schema should have the following shape:

{
                "name" : "access_key_id",
                "type" : [ "null", "string" ],
                "default" : null

When serializing an AvroField, in this library, the default value is serialized as the string literal "null" rather than the null JSON value. Looking through the code, this is caused by reusing the Schema type for this option, although the convention are a little different in reality (e.g. for types, null is written as a string). Currently this breaks compatibility when using this library with other Avro tools to read and write files.

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

1 participant