Skip to content

Add support for minProperties, maxProperties #46

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

Closed
Tatsh opened this issue May 31, 2013 · 1 comment
Closed

Add support for minProperties, maxProperties #46

Tatsh opened this issue May 31, 2013 · 1 comment

Comments

@Tatsh
Copy link

Tatsh commented May 31, 2013

minProperties and maxProperties are for objects and are mentioned here: https://github.com/json-schema/json-schema/wiki/ChangeLog
http://json-schema.org/latest/json-schema-validation.html#anchor54

This looks like it would stop this from working (which is good in some cases):

Schema:

{
  "schema": "blah-url",
  "type": "object",
  "properties": {
    "a": {
      "type": "boolean"
    }
  },
  "maxProperties": 1
}

input JSON:

{"a": true, "junk_field": 2}

Error would be on the junk_field being an extra and maxProperties being exceeded.

@mchiocca
Copy link

Hello. minProperties and maxProperties were introduced in draft-04, which is only partially implemented by this JSON Schema Validation implementation. Refer to #43, which adds the full draft-03 and draft-04 test suites. We need draft-04 compliance as well so we will be working to add missing features in the near future. So, look for these to be implemented quite soon. Thanks!

justinrainbow added a commit that referenced this issue Jun 10, 2013
Fix #46. Add support for draft v4 minProperties and maxProperties.
hakre pushed a commit to hakre/json-schema that referenced this issue Mar 26, 2015
hakre pushed a commit to hakre/json-schema that referenced this issue Mar 26, 2015
Fix jsonrainbow#46. Add support for draft v4 minProperties and maxProperties.
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

2 participants