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
Schema validation unexpectedly succeeds when key doesn't match patternProperties and additionalProperties=false #66
Comments
Thanks for the info! I'll dig into this as soon as I can. WJE's
regex support uses an optional dependency; do you happen to know if
this behaviour the same with and without it? (Don't worry about
setting that up, I'm just curious.)
…-Owen
On 3/13/17, Steve Mokris ***@***.***> wrote:
With this schema…
```
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"patternProperties": {
"^string[0-9]+$": {
"type": "string"
}
},
"additionalProperties": false
}
```
and this document…
{"foo":"bar"}
…since the key doesn't match `patternProperties`, and `additionalProperties`
is `false`, I'd expect the document to fail schema validation. But, with
wjelement-1.2, it passes:
echo 'validate patternProperties-noAdditional.jsonschema' | ./wjecli
test.json
Schema validation: PASS
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#66
|
I'm not sure offhand. I confirmed that regex support is enabled for my build (I'm successfully using |
Thanks for your patience and I'm sorry it took me so long to get around to this. I've pushed a fix, please try it out and let me know if I missed anything or broke something else. :^) Thanks @smokris ! |
Also, something something Order #66. Look out Jedi! |
Excellent. It's working nicely over here. Thanks, @penduin! |
With this schema…
and this document…
…since the key doesn't match
patternProperties
, andadditionalProperties
isfalse
, I'd expect the document to fail schema validation. But, with wjelement-1.2, it passes:The text was updated successfully, but these errors were encountered: