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

Required properties should be array on parent not boolean on children #17

Open
alexanderhawley opened this issue Jun 22, 2016 · 0 comments

Comments

@alexanderhawley
Copy link

In the example in the readme for this project, it appears as though the required properties are specified in the JSON schema by a required boolean property on each and every property which is required.

{
  "type": "object",
  "properties": {
    "name":      { "type": "string", "required": true },
    "email":     { "type": "string", "required": true },
    "address":   { "type": "string" },
    "telephone": { "type": "string" }
  }
}

However, the JSON schema specification indicates required properties are specified in the JSON schema by a required array on the parent that includes all child properties which are required.

https://spacetelescope.github.io/understanding-json-schema/reference/object.html?#required-properties

{
  "type": "object",
  "properties": {
    "name":      { "type": "string" },
    "email":     { "type": "string" },
    "address":   { "type": "string" },
    "telephone": { "type": "string" }
  },
  "required": ["name", "email"]
}

Please correct me if this is a mistake. Maybe this is a difference with previous versions of the JSON Schema specification?

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