leo-vital commented on issue #252:
URL: https://github.com/apache/avro-rs/issues/252#issuecomment-3177972207
> You could use `#[avro(default = "null")]` on the `subtitle` field. It will
produce a RecordField like:
>
> ```
> RecordField {
> name: "subtitle",
> doc: None,
> aliases: None,
> default: Some(
> String("null"),
> ),
> schema: Union(
> UnionSchema {
> schemas: [
> Null,
> String,
> ],
> variant_index: {
> Null: 0,
> String: 1,
> },
> },
> ),
> order: Ascending,
> position: 2,
> custom_attributes: {},
> },
> ```
>
> But as you already figured out the canonical form won't have the `default`
field, so most probably you will still get the same error from the registry.
Yes, I did not mention it but indeed, even using `#[avro(default = "null")]`
the generated schema does not change in its canonical form.
I ended up sending an email to the mailing list, hopefully I will get an
answer eventually.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]