flavray / avro-rs

Avro client library implementation in Rust
MIT License
169 stars 95 forks source link

How to manually create a `UnionSchema` schema? #170

Open bzm3r opened 3 years ago

bzm3r commented 3 years ago

I notice that the UnionSchema and its method new is private, and thus cannot be accessed in order to create a union's schema directly. By that I mean: without passing a string, but instead creating a schema by composing schema::Schema types.

Is this on purpose?

poros commented 3 years ago

No, there isn't much of a reason for the new method to be pub(crate) while the other methods and the struct are actually public (the fields are not and I'd like to keep them that way, as one day we might want to fully support named types in unions and they will likely need to change). Would you like to do the change yourself?