On sun 13 nov. 2022 05:34, Julien Phalip <jpha...@gmail.com> wrote:

> I've got a schema with multiple levels of depths (sub-records) that I
> would need to change slightly. [...]
>
> Is there a way to make this type of modification on an existing schema, or
> do you have to recreate the entire schema from scratch?
>

After creation, Avro schemata are immutable. To make such modifications you
can use a visitor. There already is some code available to help you along:
you can find an example in the module avro-compiler, that replaces
references to named schemata with the actual schema.

IIRC, you're looking for the Schemas class. The interface you need to
implement has the word 'visitor' in the name.

Kind regards,
Oscar

-- 
Oscar Westra van Holthe - Kind <os...@westravanholthe.nl>

>

Reply via email to