-
-
Notifications
You must be signed in to change notification settings - Fork 570
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
Ignore other properties when $ref is present #81
Comments
Not saying we shouldn't do this as an optimization, but doesn't it say something like "when ref is encountered", which sounded like it meant whenever you happen to see the reference while you are validating that schema? |
I was thinking of this line
From here: http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03 |
That line governs JSON Reference. It means that if you're resolving JSON References you shouldn't fail to resolve because the reference has other members. The relevant line covering what to do when validating JSON Schemas is:
From http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.28 |
Hmm, draft 4 just says:
|
Oh, and the 're- validate the instance' bit from draft 3 implies that any of the keywords you have already validated should be thrown out. |
I don't think that means anything has changed, it just means either it was I'm also not sure that the intent of "re-validate" is to throw out what was Either way, if you want to add the pre-check I'm fine with that, since from Hmm, draft 4 just says: JSON Schema uses JSON Reference [json‑reference] as a mechanism for schema — |
Yeah, I think ultimately there aren't going to be any schemas that have stuff other than the $ref, unless they are written wrong, so it doesn't much matter. But I think @fge has also mentioned the intent of the spec was for other properties to be ignored when $ref is present. |
0b657e8 Merge pull request #86 from kylef/patch-1 1bd4151 [README] JSONSchema.swift uses these tests too 8f86716 Revert "Add jon, JSON parser for the fishshell." db9c629 Merge pull request #82 from bucaran/patch-1 875fa42 Add jon, JSON parser for the fishshell. 64c556c Merge pull request #81 from s-panferov/patch-1 43105d4 Add new Rust library to the list aa4d927 Merge pull request #80 from seagreen/implementations 20ef067 Add new haskell implementation. 1274070 Merge pull request #79 from Muscula/json-schema-benchmark 6d8cf45 Merge pull request #78 from JamesNK/patch-1 55c4992 Add json-schema-benchmark to list of users of this test suite 645623d Added Newtonsoft.Json.Schema implementation a7944d1 Merge pull request #76 from Prestaul/patch-1 5729cdf Added skeemas to list of suite users 4600fe3 Make the implementation list a bit less unwieldy now that it's so long (hooray!) 11d6905 Merge remote-tracking branch 'mafintosh/patch-1' into develop 689b80f Merge pull request #74 from bugventure/develop c36f888 Add request-validator as a user of the test suite 41876b1 Update README.md aabcb34 Merge pull request #71 from seagreen/additionalproperties b3d160b Add tests for additionalProperties by itself. git-subtree-dir: json git-subtree-split: 0b657e8b0d21a4099d3ce378ba7208073a9295e6
According to the json reference spec, we should ignore all other properties when $ref is present. Currently we validate them all anyway.
The text was updated successfully, but these errors were encountered: