rsgen-avro icon indicating copy to clipboard operation
rsgen-avro copied to clipboard

support of namespace field

Open untereiner opened this issue 2 years ago • 2 comments

Hi,

I have a bunch an .avpr file (or a bunch of .avsc files) for whom I want to generate rust traits. These schemas are organized into namespaces. I would like to give a try to implement a possible solution. I though about modules but I am beginner in rust. Do you think it could be a good solution to organize the files and the code into a crate ?

untereiner avatar Aug 01 '22 12:08 untereiner

I think it might be possible to have rust modules corresponding to avro namespaces.

It could be within a single file or split in multiple files, although a single file sounds better to me.

I think the tricky point to add namespaces with the current implementation is that namespaces might change how the dependency order/dag is calculated (since you would need to group all structs from a same namespace together when generating it).

In any case it will be better to give it a try after the latest official avro-rs is released and integrated to this crate.

lerouxrgd avatar Aug 01 '22 12:08 lerouxrgd

I think the tricky point to add namespaces with the current implementation is that namespaces might change how the dependency order/dag is calculated (since you would need to group all structs from a same namespace together when generating it).

yes what's true. I will give it a try when rsgen-avro has officially moved to the apache-avro rust implementation.

untereiner avatar Aug 01 '22 12:08 untereiner