I’ve got an Avro schema registered to my cluster which works great when using a Kafka producer client. Ideally, I’d like to enforce the same schema when using the REST API to publish messages also. From what I can gather, I’m supposed to use the value_schema_id
in the body when sending data via POST
:
{
"value_schema_id": 6,
"records": [
{
"value": {
"foo": "bar",
...
}
}
]
}
However, no matter what I put as the value_schema_id
value, the message is accepted into the topic. Same goes for if I deviate the record
structure from the actual schema format, which means I can’t enforce the schema from behind the REST API.
I’ve even tried submitting the entire Avro JSON inline using value_schema
and still it accepts anything I put in there as well as the payload.
Can I enforce registered schemas from the Kafka REST API? If so, how?
Thanks