-
-
Notifications
You must be signed in to change notification settings - Fork 314
Drop the concept of an "initial base URI" from the spec #1322
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
Comments
Are you really trying to get rid of a certain amount of redundant text in the spec, or is this really about the word "initial"? I've stated before that I support getting rid of redundant text. |
BTW I am also fine with getting rid of the word "initial" (although I remain puzzled by the objection), I just see this as two separate things. |
The problem can be solved in two ways. One way is to remove the redundant text and just reference RFC-3986. The other way is to update the language to only use RRC-3986 terminology. I prefer the first solution, but I would accept the second. The problem isn't the word "initial", it's using the concept of an "initial base URI" rather than using the RFC-3986 concepts. It doesn't matter what word you use. |
I do not see any contradictions of RFC 3986 in our §9.1.1. However, it is mostly redundant. Everything except the first paragraph/sentence can be removed, and replaced with the requirement regarding JSON Schema implementations per issue #1299. The point of §9.1.1 is to ensure that JSON Schema implementations accommodate RFC 3986 requirements. That's why I filed #1299, because the current section doesn't actually accomplish this in a clear enough way to result in implementations doing the right thing consistently. |
Agreed, but if a requirement regarding implementations is added, it needs to address retrieval URIs and default base URIs separately, not initial base URIs. |
This comment was marked as off-topic.
This comment was marked as off-topic.
I'm marking my previous comment as off-topic as the essentials are already covered in #1299, and I need to respect my own partition of this topic that I demanded in that issue. I apologize for re-muddling it. @jdesrosiers if it sounds good to you, I am content to consider this issue settled with:
|
@jdesrosiers Sorry for piling on an old thread but I'm a bit confused. From my reading of this issue and #1299 one of the goals is to encourage library developers to provide a way for applications to supply a base URI that might have been the Are you suggesting that implementations should provide a way for the application to set both the I guess the other alternative is to assume that JSON Schema doesn't really care what the |
The spec references RFC-3986 for how to determine the base URI for relative reference resolution. It also has a concept of an "initial Base URI". This concept unnecessarily complicates the model and should be removed. The concepts of retrieval URI and default base URI as defined in RFC-3986 are enough.
The initial base URI can be viewed as essentially the retrieval URI and the default base URI compressed into one step and determined by the user. Presenting these as one step is at best confusing, especially if we want to encourage implementers to provide more robust schema identification features such as was proposed in #1299. For example, it makes sense to allow a user to set a default base URI as a global configuration and a retrieval URI per schema. Some implementations may allow you to set a retrieval URI, but not a default base URI, or vice versa.
Additionally, an "initial base URI" can be ambiguous. If it's a retrieval URI, a user should expect the schema to be referenceable by that URI. If it's a default base URI, the user shouldn't expect it to be referenceable by that URI. If the implementation only takes an "initial base URI", it can't know the difference.
It could be argued that the "initial base URI" concept is still there in these more robust cases, it's just calculated within the implementation rather than as a single input by the user. However, it's unclear in the spec that that's a choice implementers have let alone something they should do. If we stick to RFC-3986 concepts, it's more clear to implementers what they are allowed to do and what they should be doing it their implementations.
Reference: https://json-schema.org/draft/2020-12/json-schema-core.html#section-9.1.1
The text was updated successfully, but these errors were encountered: