Skip to content

Test case for $ref resolution in case of URN $id #250

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

Closed
vearutop opened this issue Jan 28, 2019 · 4 comments
Closed

Test case for $ref resolution in case of URN $id #250

vearutop opened this issue Jan 28, 2019 · 4 comments
Labels
missing test A request to add a test to the suite that is currently not covered elsewhere.

Comments

@vearutop
Copy link

It is not apparent how reference resolution should happen in case base $id is having urn:... value and $ref is subschema.json.

@awwright
Copy link
Member

awwright commented Jan 28, 2019 via email

@vearutop
Copy link
Author

RFC 3986:

When presented with a URI that violates one or more scheme-specific
restrictions, the scheme-specific resolution process should flag the
reference as an error rather than ignore the unused parts; doing so
reduces the number of equivalent URIs and helps detect abuses of the
generic syntax, which might indicate that the URI has been
constructed to mislead the user (Section 7.6).

According to RFC it seems such case should be an invalid schema, so it might not belong to JSON Schema Test Suite as suite expects valid schema with valid/invalid test data.

@handrews
Copy link
Contributor

@vearutop let's be careful about "URI scheme-specific error" and "invalid schema". schemE and schemA are quite different here.

However, I agree that checking for an error here would be something that a reference resolver that understands the urn: scheme should handle, and not part of JSON Schema's test suite.

We can test that an implementation can handle urn: references (because in that case we are testing that the implementation provides the library support at all). But we probably shouldn't get into testing how well the URN implementation chosen by the JSON Schema implementation handles weird cases.

scheme-specific reference resolution information for urn: can be found in https://tools.ietf.org/html/rfc8141#section-4.3

@Julian Julian added the missing test A request to add a test to the suite that is currently not covered elsewhere. label Sep 27, 2019
@Julian
Copy link
Member

Julian commented Nov 29, 2019

Think this is a duplicate of #179. Going to close this in favor of that one, though yeah definitely seems like we need some of these.

@Julian Julian closed this as completed Nov 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
missing test A request to add a test to the suite that is currently not covered elsewhere.
Projects
None yet
Development

No branches or pull requests

4 participants