This issue occurs when a schema is registered with schema references. Several of the schema registry APIs return schemas that do not correctly construct their list of references.
The lookup_schema(), get_latest_version(), and get_version() methods return a RegisteredSchema. Per the documentation, the schema property is a Schema object. However, the Schema object's list of references is a list of dictionaries rather than a list of SchemaReference objects.
The RegisteredSchema.schema.references property should return a list of SchemaReference objects to be consistent with the Schema returned by the get_schema() method and match the documentation.
How to reproduce
If you run the following script, it will create two schemas. The second schema will reference the first. It will then call all 4 APIs that return Schema objects or RegisteredSchema objects that have a Schema property. The script will show that the references in the Schema from 3 of the APIs are dictionaries instead of SchemaReference objects.
Description
This issue occurs when a schema is registered with schema references. Several of the schema registry APIs return schemas that do not correctly construct their list of references.
The
SchemaRegistryClient
get_schema()
method](https://github.com/confluentinc/confluent-kafka-python/blob/master/src/confluent_kafka/schema_registry/schema_registry_client.py#L372) returns aSchema
object with a correctly built list of references. Each item is aSchemaReference
object per the documentation.The
lookup_schema()
,get_latest_version()
, andget_version()
methods return aRegisteredSchema
. Per the documentation, theschema
property is aSchema
object. However, theSchema
object's list of references is a list of dictionaries rather than a list ofSchemaReference
objects.The
RegisteredSchema.schema.references
property should return a list ofSchemaReference
objects to be consistent with theSchema
returned by theget_schema()
method and match the documentation.How to reproduce
If you run the following script, it will create two schemas. The second schema will reference the first. It will then call all 4 APIs that return
Schema
objects orRegisteredSchema
objects that have aSchema
property. The script will show that the references in theSchema
from 3 of the APIs are dictionaries instead ofSchemaReference
objects.Checklist
Please provide the following information:
confluent_kafka.version()
andconfluent_kafka.libversion()
): confluent-kafka-python = ('1.8.2', 17302016), librdkafka = ('1.8.2', 17302271){...}
'debug': '..'
as necessary)