Skip to content

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

Open
@mokobrosli

Description

@mokobrosli

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions