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

Client method getSchemas() does not inform about the version of the returned AVRO schemas #3280

Open
fmiguelez opened this issue Sep 19, 2024 · 1 comment

Comments

@fmiguelez
Copy link

fmiguelez commented Sep 19, 2024

Even though REST call to endpoint /schemas returns corresponding version with each schema entry, in the object ParsedSchema (implemented by AvroSchema) is set to null.

The BUG is in this line of AvroSchemaProvider:

https://github.com/confluentinc/schema-registry/blob/9e7ab57e7f1d5664bc08f42ad9678c5b68a769d8/client/src/main/java/io/confluent/kafka/schemaregistry/avro/AvroSchemaProvider.java#L55C11-L55C15

It should set the version that comes in Schema object:

  @Override
  public ParsedSchema parseSchemaOrElseThrow(Schema schema, boolean isNew, boolean normalize) {
    try {
      return new AvroSchema(
          schema.getSchema(),
          schema.getReferences(),
          resolveReferences(schema),
          schema.getMetadata(),
          schema.getRuleSet(),
          schema.getVersion(), // Proposed change
          (validateDefaults || normalize) && isNew
      );
    } catch (Exception e) {
      log.error("Could not parse Avro schema", e);
      throw e;
    }
  }
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

2 participants
@fmiguelez and others