Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
mokobrosli opened this issue Nov 1, 2023 · 2 comments · May be fixed by #293
Open

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

mokobrosli opened this issue Nov 1, 2023 · 2 comments · May be fixed by #293

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.

@wk989898
Copy link

Is there anyone working on this bug?

@mihaitodor
Copy link
Collaborator

@wk989898 Not that I'm aware. PRs are welcome!

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

Successfully merging a pull request may close this issue.

3 participants