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

JSON::Validator.fully_validate returns error for valid schema with "not" keyword in it #84

Closed
vladimeeer opened this issue Oct 30, 2013 · 1 comment

Comments

@vladimeeer
Copy link

Here is a schema and test data for validator:

data    = '{ 
                  "id" : 1,
                  "name" : "Zoo",
                  "keywords" : ["Monkey", "Tiger"]
                }'
      schema  =  '{
            "type": "object",
            "properties": {
                "id": {"type": "integer", "minimum": 1},
                "name": {"type": "string"},
                "keywords": {
                    "type": "array",
                    "items": {
                        "type": "string",
                        "not": {"enum": ["", "Tocan"]}
                      },
                    "uniqueItems": true
                }
            }
        }'

JSON::Validator.validate!(schema, data) return true.
JSON::Validator.fully_validate(schema, data) return array of errors related to "not" keyword in the schema.

@hoxworth
Copy link
Contributor

hoxworth commented Jan 1, 2014

Fixed in 2.1.5 - the "errors" were errors that accumulated when the "not" schema was validated, which of course SHOULD fail in a successful validation. Thanks!

@hoxworth hoxworth closed this as completed Jan 1, 2014
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