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

Adding support for required array from http://tools.ietf.org/html/draft-... #325

Merged
merged 2 commits into from
Mar 25, 2015

Conversation

dmcfarland
Copy link

Adding support for required array from http://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.3

As described under #323

In json_schema v4, the idiomatic way to do required properties is with a required array at the end of the object:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "$ref": "#/definitions/abc",
  "id": "resource:///json_schema/match/abc.json#",
  "definitions": {
    "abc": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "age": {
          "type": "string"
        }
      },
      "required": ["name", "age"]
    }
  }
}

@joelittlejohn
Copy link
Owner

Hi David. Thanks a lot for tackling this, a lot of people will find it useful.

The one thing we need before I can merge this is an integration test to cover this feature. Hopefully you can use the current RequiredIT for an example of how to write these. There are helpers to generate and compile code during the test so they're quite straight forward to write.

@dmcfarland
Copy link
Author

Thanks for pointing out the missing integration test. Hopefully should be committed now.

@tylerprete
Copy link

@dmcfarland Thanks for implementing this!

@joelittlejohn joelittlejohn added this to the 0.4.11 milestone Mar 24, 2015
joelittlejohn added a commit that referenced this pull request Mar 25, 2015
@joelittlejohn joelittlejohn merged commit 02c8a84 into joelittlejohn:master Mar 25, 2015
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

Successfully merging this pull request may close these issues.

None yet

3 participants