Greetings.

I tried opening a GitHub issue in the Rust Apache Avro repository here (
https://github.com/apache/avro-rs/issues/252), but they recommended I send
an e-mail to this mailing list. I apologize if I am doing something wrong.

Essentially, I was trying to add a new optional field to a Rust struct that
uses a macro from that crate to automatically generate its schema. However,
when generating the Parsing Canonical Form for that schema and trying to
register it in the Registry Schema, I was getting an error like the
following:

io.confluent.kafka.schemaregistry.exceptions.IncompatibleSchemaException:
[{errorType:'READER_FIELD_MISSING_DEFAULT_VALUE', description:'The field
'field_name' at path '/fields/6' in the new schema has no default value and
is missing in the old schema', additionalInfo:'field_name'},...

And even when I marked the field as having the default value of null in the
Rust code, the same error kept happening, since in the PCF the default
value is discarded due to the STRIP rule.

So my question is: is it simply impossible to use the PCF to create a new
schema version that is backwards-compatible when adding a new optional
field to a schema, since the Registry requires a default value to be set,
but the PCF discards the default fields? If so, is there no automatic way
to create a backwards-compatible schema that has an added optional field,
i.e. when that happens I need to write a schema manually and register it in
the Registry?

I appreciate any help on this and again apologize if I am doing something
wrong in the way I am sending this email.

Reply via email to