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

Incorrect Object validation #42

Open
ghost opened this issue Dec 2, 2013 · 0 comments
Open

Incorrect Object validation #42

ghost opened this issue Dec 2, 2013 · 0 comments

Comments

@ghost
Copy link

ghost commented Dec 2, 2013

Not sure if this project is still alive, but.

Let's take this simple JSON:

[ { "foo": "bar" } ]

and a schema for it:

{
    "type": "object"
  , "$schema": "http://json-schema.org/draft-03/schema"
  , "id": "http://jsonschema.net"
  , "required": true
  , "properties": {
        "foo": {
            "type": "string"
          , "id": "http://jsonschema.net/foo"
          , "required": true
        }
    }
}

This should be invalid, and it is if you validate your schema with JSV and schema modules. json-schema, though, says that this JSON is valid, probably because of validate.js:93, since typeof [] === 'object'.

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

0 participants