lerouxrgd / rsgen-avro

Command line and library for generating Rust types from Avro schemas
MIT License
34 stars 26 forks source link

support of namespace field #31

Open untereiner opened 2 years ago

untereiner commented 2 years ago

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 ?

lerouxrgd commented 2 years ago

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.

untereiner commented 2 years ago

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.