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

Allow any @ark/schema Root as input for a union branch or morph endpoint #1067

Open
ssalbdivad opened this issue Jul 26, 2024 · 0 comments
Open

Comments

@ssalbdivad
Copy link
Member

To ensure normalized strucutre, a UnionNode is not allowed to have UnionNode children, and a MorphNode is not allowed to have a MorphNode as it's in or out validator.

This is critical to how the type system works, but it would that normalization process should be handled internally when parsing definitions, meaning that a UnionSchema definition including other UnionSchemas as branches should be valid, as should a Morph of the same kind.

As is, we are forced to normalize this in other places to compensate for the lack of ability to normalize it centrally.

I've begun addressing this to some extent (e.g. allowing BaseRoot as an input for a UnionBranch), but it should be made much more general.

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

No branches or pull requests

1 participant