Skip to content

Conversation

@gwallet
Copy link

@gwallet gwallet commented Sep 19, 2025

The Java JsonDecoder does not actually allow there to be unknown fields in the reader compared to the writer's schema. In cases where this happens it gives the following error: org.apache.avro.AvroTypeException: Expected Unknown fields: []. Got END_OBJECT

What is the purpose of the change

This pull request makes the JsonDecoder allow unknown fields in the reader, fixing AVRO-3106.

Verifying this change

This change is already covered by existing tests, such as TestEncoders#jsonExcessFields.
It has been adapted to reflect the change.

Documentation

  • Does this pull request introduce a new feature? no

The Java JsonDecoder does not actually allow there to be unknown fields in the reader compared to the writer's schema.
In cases where this happens it gives the following error:
org.apache.avro.AvroTypeException: Expected Unknown fields: [<field name redacted>]. Got END_OBJECT
@github-actions github-actions bot added the Java Pull Requests for Java binding label Sep 19, 2025
@RyanSkraba
Copy link
Contributor

Hello! Thanks for your contribution -- I just want to clarify: the JsonDecoder does work if the writer schema and the reader schema are both present right? The test case only shows the reader schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Java Pull Requests for Java binding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants