Closed ThinhLe30 closed 5 months ago
An optional field is a union of null and the type, such as "type": ["null", "string"]
already try it, it's the same response
old schema:
{
"type": "record",
"name": "user",
"fields": [
{"name": "name", "type": "string"},
{"name": "favorite_number", "type": "int"}
]
}
new schema:
{
"type": "record",
"name": "user",
"fields": [
{"name": "name", "type": "string"},
{"name": "favorite_number", "type": "int"},
{"name": "favorite_color", "type": ["null", "string"], "default": null}
]
}
and the response: :(((
Here is my case: The registered old schema:
The new schema which I have added a new optional field:
Then I use the rest-API to check compatibility: According to these pages: https://docs.confluent.io/platform/current/schema-registry/fundamentals/schema-evolution.html#backward-compatibility https://docs.confluent.io/platform/current/schema-registry/develop/api.html#sr-api-compatibility
and the request body:
and the response:
This seems weird because the BACKWARD compatibility already supports adding an optional field :(( Anybody can explain it to me?w