1
votes

I'm working with Avro/Kafka and Confluent's Schema Registry for Avro.

I made some basic schemas and subjects with basic types using avsc files and avdl.

I am looking at the API's documentation made by Confluent to try to evolve a Schema to version 2. Particularly this part:

https://docs.confluent.io/current/schema-registry/using.html#register-a-new-version-of-a-schema-under-the-subject-kafka-key

But when I try to POST to this endpoint I get a 422 Conflict.

I'm using BACKWARDS compatibility and am updating just one field from the previous version:

{
    "type": "record",
    "name": "Address",
    "fields": [
        {"name": "id", "type": "string"},
        {"name": "street", "type": "string"}
    ]
}

And the new version:

{
    "type": "record",
    "name": "Address",
    "fields": [
        {"name": "id", "type": "string"},
        {"name": "street", "type": "string"},
        {"name": "number", "type": "int"}
    ]
}

Can anyone tell me how to evolve a schema?

1

1 Answers

0
votes

Solved it by setting the

access.control.allow.methods=GET,POST,OPTIONS,PUT,DELETE

I had previously set to allow CORSto * but it seems it just allows GET (?) so after changing this property I was able to change/evolve the schema.