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

Support for required: true (all properties required) syntax? #280

Open
githorse opened this issue Jan 21, 2022 · 0 comments
Open

Support for required: true (all properties required) syntax? #280

githorse opened this issue Jan 21, 2022 · 0 comments

Comments

@githorse
Copy link

githorse commented Jan 21, 2022

See this StackOverflow question lamenting the repetitiveness of the required key in schemas like:

"type": "object",
"properties": {
  "foo": { "type": "string" },
  "bar": { "type": "string" },
  "baz": { "type": "string" },
},
"required": ["foo", "bar", "baz"]

This gets pretty ugly and error-prone with larger schemas. The suggested minProperties fix is problematic when the object might have additional properties on it.

Would it be possible to support a shorthand syntax like required: true? (Or maybe optional: [])?

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