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

Address base URI for JSON Schema embedded in other documents #837

Closed
handrews opened this issue Jan 15, 2020 · 2 comments · Fixed by #983
Closed

Address base URI for JSON Schema embedded in other documents #837

handrews opened this issue Jan 15, 2020 · 2 comments · Fixed by #983
Assignees
Labels
clarification Items that need to be clarified in the specification core Priority: High

Comments

@handrews
Copy link
Contributor

In the discussions around JSON Schema and OpenAPI Specification 3.1, we need to clarify the determination of the base URI for each of the embedded JSON Schema resources.

The OAS document has its own media type, and its own rules for determining a base URI. These fall under RFC 3986's "base URI embedded in the document" approach. We should probably update our own section 8.2.1 Initial Base URI to note that, in the case of a JSON Schema resource embedded in a document of another media type, the initial base URI is determined according to the rules of that media type.

This is philosophically consistent with what's already there, I believe, and would clarify an important use case. And would mean that specifications like OAS 3.1 would not have to call it out as a special case.

Also paging @webron @darrelmiller @philsturgeon

@Relequestual
Copy link
Member

To confirm, this is in the case where the JSON Schema object doesn't define its own $id?

If the goal is making sure "insert this json schema here and it works", then JSON Schema has to still be allowed to define its own base URI.

Assuming I'm correct here, are we just reitterating what's already in RFC 3986?
https://tools.ietf.org/html/rfc3986#section-5.1.2 ?

OR, are we saying this is two cases of "5.1.1. Base URI Embedded in Content", and we need to determine if the JSON Schema $id or the base URI as determined by OAS is the one by which relative references should be resolved?

I think I'm clear that it's the first, but we need to specify that the initial base URI is defined by the enclosing document should it not be defined by the JSON Schema document object (which I read as per RFC 3986 5.1.2 anyway).

@handrews

This comment has been minimized.

@handrews handrews self-assigned this Feb 13, 2020
@helpr helpr bot added the pr-available label Sep 6, 2020
@helpr helpr bot added pr-merged and removed pr-available labels Sep 25, 2020
@gregsdennis gregsdennis added clarification Items that need to be clarified in the specification and removed Type: Maintenance labels Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Items that need to be clarified in the specification core Priority: High
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants