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

Fragment identifier for yaml and +yaml #21

Closed
1 of 2 tasks
ioggstream opened this issue Feb 20, 2022 · 7 comments · Fixed by #38
Closed
1 of 2 tasks

Fragment identifier for yaml and +yaml #21

ioggstream opened this issue Feb 20, 2022 · 7 comments · Fixed by #38
Labels
Milestone

Comments

@ioggstream
Copy link
Collaborator

ioggstream commented Feb 20, 2022

Question

Compile fragment identifier section

Can we pospone this?

@richsalz
Copy link

It seems strange to me that a media type would define a new "language" intrinsic.

@cjaccino
Copy link

I believe the registration should include the fragment identifier. +json does not identify one, which creates problems. It probably should have a registration update to address it.

Not registering fragment handling means that a reference to a YAML-borne schema cannot be referenced. The part beyond the # would be formally nonsensical (as it is today).

We can take some inspiration from the work on the same issue for JSON Schema. JSON Pointer tells us how to craft fragments. The same format applies to the semantic equivalent in YAML documents.

I'll put in a pull request.

@ioggstream
Copy link
Collaborator Author

@cjaccino we have splitted the two documents. I think that yaml fragment identifiers should probably be delegated to "structured" media types since there are multiple possibilities (eg. json-path, json pointers, ...)

WRT openapi+yaml for example, we can state that the fragment uses json pointers.

@ioggstream
Copy link
Collaborator Author

@eemeli Can you confirm that the YAML community agrees with the current statement wrt fragment identifiers?

@eemeli
Copy link
Collaborator

eemeli commented Apr 5, 2022

I'm pretty sure that fragment identifiers should not be defined for +yaml at least for now. As demonstrated e.g. by the work going on even in this repo, YAML is used to represent multiple different forms of structured data, some of which may at times be represented by other formats, such as JSON.

So while YAML 1.1 and 1.2 do explicitly support &anchors on nodes that would rather naturally work as fragment identifiers, there's somewhat significant risk that this would complicate usage with sub-formats that natively use different methods, such as JSON Pointers.

On the other hand, defining fragment identifiers for application/yaml to follow the YAML spec for referring to anchors would make sense.

@richsalz
Copy link

richsalz commented Apr 5, 2022

I'm pretty sure that fragment identifiers should not be defined for +yaml at least for now.

FWIW, I completely agree.

@ioggstream
Copy link
Collaborator Author

The choice to leave the fragment identifier of the structured syntax suffix to the media type is sensible: I will PR that.

ioggstream added a commit that referenced this issue Apr 5, 2022
ioggstream added a commit to eemeli/httpapi-mediatypes that referenced this issue Apr 12, 2022
@ioggstream ioggstream added this to the YAML milestone Apr 25, 2022
ioggstream added a commit that referenced this issue May 12, 2022
* Define fragment identifiers for application/yaml

* Use first match when alias targets are not unique

* Update draft-ietf-httpapi-yaml-mediatypes.md

Co-authored-by: Roberto Polli <robipolli@gmail.com>

* Fix: #21. Fragment identifiers.

* typos

* Update draft-ietf-httpapi-yaml-mediatypes.md

Co-authored-by: Roberto Polli <robipolli@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging a pull request may close this issue.

4 participants