Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to manually create a UnionSchema schema? #170

Open
bzm3r opened this issue Jan 4, 2021 · 1 comment
Open

How to manually create a UnionSchema schema? #170

bzm3r opened this issue Jan 4, 2021 · 1 comment

Comments

@bzm3r
Copy link

bzm3r commented Jan 4, 2021

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
Copy link
Collaborator

poros commented Jan 6, 2021

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants