-
Notifications
You must be signed in to change notification settings - Fork 91
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
Clarification on validating the URI format and the reason for strictUris mode. #18
Comments
@k7sleeper look here, https://github.com/json-schema/JSON-Schema-Test-Suite/blob/develop/tests/draft4/optional/format.json , your schemaA is |
Thanks very much. |
I'm a bit puzzeled: how does the test conform to JSON Schema: core definitions and terminology, section 7.2.1 and 7.2.2? |
If you think the test is not correct, definitely open an issue at https://github.com/json-schema/JSON-Schema-Test-Suite repository. I'll fix any changes to those tests. Also keep this issue open, I'll look into it more when I'll have time. |
As soon as I understand the difference between "URI" and "URI Reference", I open an issue if justifed. |
Here it says it must be valid according to RFC3986 - http://json-schema.org/latest/json-schema-validation.html#anchor123 Here http://tools.ietf.org/html/rfc3986#appendix-A you can see URI defined as: So your |
But, in my opinion, we cannot ignore JSON Schema: core definitions and terminology, section 7.2.1 and 7.2.2? As far as I see, attribute How can the following problem be solved: a couple of JSON files in a local directory, each JSON file contains a schema, some of the schemas refer to others by id. Briefly: I gues, attribute |
Well, I prefer not to ignore any part of JSON Schema that I'm able to implement. There is always an option that you can remove $schema from your schemas and it will work fine. If you wish, I can add an custom switch so validator will skip validation against $schema. |
|
That is quite a good point :). I don't think I ever noticed that section (7.2.1) using things that are not valid URIs. I was the one who wrote that test (in response to a bug report from someone complaining that I also think that that usage of So, in short, I think that probably what's wrong here is the meta schema -- I think @fge wrote it, and probably can clarify the intentions. @geraintluff is writing draft 5 and probably also can clarify, and especially I'm pinging him to let him know about the ambiguity here :). |
I had assumed that I also think the wording for v4 is not good - after all, the examples in section 7.2.2 include |
@zaggino: After all, I'd suggest to support also relative URIs for the |
If I'll replace But in the end, positives probably outweigh negatives for now. I'll put an option to turn on strict URIs or something. |
Thanks, that's useful. |
Having a schema with
$schema: 'http://json-schema.org/draft-04/schema#'
, setting remote schemaand validate something against that schema, leads to
If I remove
$schema: 'http://json-schema.org/draft-04/schema#'
from my schema validation is ok.My schema is quite simple:
If I change the
id
value from'schemaA'
to'http://my.company.de/project#mainSchema'
then validation is ok. Isn't'schemaA'
a valid URI ?The text was updated successfully, but these errors were encountered: