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

anyOf without visual components #6

Open
brollb opened this issue Aug 29, 2023 · 0 comments
Open

anyOf without visual components #6

brollb opened this issue Aug 29, 2023 · 0 comments

Comments

@brollb
Copy link
Collaborator

brollb commented Aug 29, 2023

This isn't terribly pressing but I wanted to make an issue for what we saw yesterday. Basically, it is possible for anyOf to be used in JSONSchema to ensure other constraints about an object. In yesterday's example, we were trying to ensure that at least one key was required in an object. The suggested solution was to do something like this:

{
  "anyOf": [
    { "required": ["key1"] },
    { "required": ["key2"] },
    // ...
    { "required": ["keyN"] }
  ]
}
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