Skip to content

Conversation

@passuied
Copy link
Contributor

@passuied passuied commented Jan 4, 2026

Description

  • Add ability to ignore extra fields from textual representation

  • Approach:

    1. A way to skip arbitrary JSON values without a codec
    2. An option to enable lenient behavior
    3. Passing this option through the codec builder chain
  • Usage example:

opt := &goavro.CodecOption{
    IgnoreExtraFieldsFromTextual: true,  // Ignore unknown fields during JSON decoding
}
codec, err := goavro.NewCodecWithOptions(schema, opt)

// Now this will work even with extra fields in JSON
native, _, err := codec.NativeFromTextual([]byte(`{"knownField": "value", "unknownField": "ignored"}`))

Issue Reference

#294

@passuied
Copy link
Contributor Author

passuied commented Jan 4, 2026

@rockwotj Re-implemented the solution. Please review

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

Successfully merging this pull request may close these issues.

1 participant