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

Converting default value string of null to nil breaks legitimate schema. #280

Open
mokobrosli opened this issue Nov 1, 2023 · 0 comments

Comments

@mokobrosli
Copy link

if defaultValue == "null" {

This line treats "null" and null as equivalent for default values, however that is not the case. Having a default value that is actually the string "null" will fail when creating a new Codec.

To reproduce simply try goavro.NewCodec(sample) where sample is :

{ "name": "test_str", "type": [ "string", "null" ], "default": "null" }

The above would pass if the union was defined with null type as its first element but that's a different case. This would fail as well if it was a simple string type.

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