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

JSON: type-narrow enum, oneOf, and anyOf #1038

Open
hudson-ai opened this issue Oct 2, 2024 · 0 comments
Open

JSON: type-narrow enum, oneOf, and anyOf #1038

hudson-ai opened this issue Oct 2, 2024 · 0 comments
Assignees

Comments

@hudson-ai
Copy link
Collaborator

If type keyword co-occurs with enum, oneOf, or anyOf, we should be able to "narrow" the choices based on that type.

e.g.

{"type": "string", "enum": ["1", "2", 3]}

->

{"enum": ["1", "2"]}

Note: we in general need to add "intersection" logic like this... e.g. $ref plus properties can be joined into a single schema. More general problem: allOf

@hudson-ai hudson-ai self-assigned this Oct 2, 2024
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

1 participant