confluentinc / kafka-rest

Confluent REST Proxy for Kafka
https://docs.confluent.io/current/kafka-rest/docs/index.html
Other
47 stars 647 forks source link

Producing jsonschema records, always gives "Error registering JSON schema" #664

Open gschaden opened 4 years ago

gschaden commented 4 years ago

When trying to send records to a json schema topic, rest proxy always tries to overwrite the defined schema with some default value {\"$schema\":\"http://json-schema.org/draft-04/schema#\",\"title\":\"Object Node\"}"

The example from the quick start guide does not work if the value schema is set to "{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"}}}" and the compatibility mode to full.

Tracing down the code, I think that the code in io.confluent.kafka.serializers.json.KafkaJsonSchemaSerializer#serialize which is called during sending data to the broker, always uses the generic ObjectNode to lookup the schema. The original schema_value is not available in this class.

gschaden commented 4 years ago

I don't know, if this issue should be reported on schema registry