Skip to content

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

@githorse

Description

@githorse

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: [])?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions