-
Notifications
You must be signed in to change notification settings - Fork 4
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
+yaml fragment parsing compatibility #50
Comments
The whole idea of an SSS is being able to make use of the base media type if the specific media type is not known. So I don't think that a specific media type design that would assign a different meaning to /...+*...+ would be the right thing to do (BTW, the empty fragment identifier is missing in your list). But they can use the space deliberately left free here, and I would recommend being specific that a=b is the recommended option for that. |
I agree with @cabo . [EDIT: RFC quote removed b/c I misread it. I thought it said SSS MUST use the base media type's fragment identifier, but it says that specific SSS's MUST use the fragment identifiers registered in the suffix's registration, which I gather are not required to include the base media type fragment identifiers for some reason] And yes, this:
needs to be changed to include the empty string "" as a JSON Pointer. |
I don't think we ought to have such a SHOULD statement, unless the intent with it is to make it clear that a subtype MAY choose to follow the As for how to handle an empty string fragment, is that somehow different for JSON pointers from how a URL without a fragment identifier is handled, or is it the same? |
@eemeli empty strings are not a special case, they're normal JSON Pointers (they are included in the RFC examples for both string representation and URI fragment representation.) An empty string JSON Pointer fragment refers to the entire document, so it is semantically equivalent to not having a fragment. This means that JSON Pointer fragments are compatible with other fragments that also use the empty string to reference the whole document (and do not otherwise overlap with JSON Pointer syntax). But not with a hypothetical syntax where a document author could assign the empty fragment to some subset of the resource (I'm not aware of any such syntax, but AFAIK there's nothing in RFC3986 that requires the empty fragment to reference the entire resource, and that conversion is not a standard part of URL normalization). |
To clarify:
How application/yaml processes fragment is outside the topic of this issue and needs to be agreed with the YAML community.
IIUC @cabo proposes that for interoperability While I think that it would be cool, I am afraid that it could conflict with some xxx+yaml candidate. Some examples:
With the current layout, xxx+yaml have more freedom, and application/yaml is free to evolve without breaking existing implementations. My 2¢, R. |
@ioggstream OK let me see if I understand this: |
@handrews the history:
Honestly I think this process was all in the interest of preserving subtypes :) |
I think it is worth pointing out that this is also needed for full RFC 6901 JSON pointer support. |
@ioggstream I just don't understand why the empty string and starting with "/" are separate cases. As @cabo notes, both are equally part of RFC 6901. I also don't understand how treating these two parts of RFC 6901 as separate cases, one of which references RFC 6901 and the other of which is defined completely outside of it but happens to align, preserves subtypes. I am assuming that by subtypes you mean further |
Since JSON Pointer is a different document, we needed to isolate the impacts of changes in JSON Pointer on YAML fragments. The current behaviour is acceptable because it is the same for JSON Pointer and alias nodes. But we want to be clear that only fragments starting with / are "delegated" to an external spec. If RFC6901 changes, it will only affect fragments starting with /. About xxx+yaml ( I called them "subtypes" but dunno if that's correct) , the original proposal from YAML community was to only support YAML plain names. In this case, the empty fragment would have still referenced the root node. But a xxx+yaml media type using plain names would have conflicted with application/yaml. Hth :) |
I think this whole story is worth an FAQ... Thanks for the opportunity to write it down! @handrews |
I might be missing something here. I don't think this would be compatible with JSON Schema. If YAML requires that alias nodes start with Or is the point that plain-names are left undefined and a media type like |
@jdesrosiers this:
But see also PR #54 |
You are not required to reference nodes using alias nodes fragid.
If +yaml and yaml fragments are disentangled, schema+yaml is free to define its plain names. Otherwise there might be future clashes. In this work, I am trying to balance the views of the YAML, API/Schema and Linked Data communities. I think that the YAML community should have the lead for defining the application/yaml fragment, since they will evolve the language and the implementations in the next years. This document should build on their work without limiting them. About xxx+yaml fragids:
About application/yaml and +yaml fragments, Media Type RFC states that:
|
@ioggstream I realized that the |
Yes, schema+yaml should add plain name fragments according to JSON Schema |
Closed according to the discussion during IETF-114. SSS does not mandate having the same base media type fragid. |
Discussion
Currently +yaml SSF delegates fragment identification to the specific media type registrations (e.g. application/openapi+yaml)
IMHO this is the correct approach because we do not want to limit the ability to define fragment identifier for subtypes which already exists but are not registered.
I know that other xxx+json subtypes took a different approach, and they reference the JSON fragment identifier instead. I think that this is not the case for YAML because:
The most we can do is xxx+yaml SHOULD explain why they are not using the application/yaml fragment identifier
WDYT cc: @cabo @eemeli
The text was updated successfully, but these errors were encountered: