Hey, can you investigate using ‘get_schema_in_ctxt’ for your use case? The AvroSchema derivation also implements the trait AvroSchemaComponent with allows it to handle the nested/recursive use case, but the raw method should be available to use, which should allow injecting schemas. The other thing I’ll mention is that the derive trait works for generic rust params. Aka you can have a type T that implements AvroSchemaComponent and use it within your structs. If your protocol needs to be genetic over multiple types you can create any number of container types with this param.
Best, Jack On Mon, Dec 12, 2022 at 11:18 AM Mark Farnan <[email protected]> wrote: > Hi All, > > A week or so back, I created. > https://issues.apache.org/jira/browse/AVRO-3683 (AVRO RUST) > > I've been trying to figure out if I can implement a solution, however my > rust skills are not up to the task as yet. > > This is currently blocking my use of AVRO-RUST for a new project to > implement an Industry standard communications protocol, which is based on > AVRO. The standard makes extensive use of types referenced in other schema > files. There are some 200+ schema files in the standard. > > On further investigation of the issue, I noticed that if a simple Schema > also has AvroSchema on it, then the schema generated from this WORKS for > the nested types, but the one generated by parse_list does not. (The > Schema from AvroSchema seems to resolve the nested types fine into the > resulting schema). > > NOTE: I CANNOT use 'AvroSchema' for my industry standard schema's, as they > use features AvroSchema does not support. So need parse_list to create > valid schemas. > > I think if parse_list was changed to create schema's which correctly > contained the referenced types, rather than by ref, then this would work > fine. I imagine it will also need logic to not duplicate any given schema > more than once. > > Hoping someone can take a look at this. > > Regards > Mark >
