-
Notifications
You must be signed in to change notification settings - Fork 28
feat: clarifies format interoperability #246
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Vincent Biret <[email protected]>
What do you mean by this exactly? |
|
@baywet now I'm even more confused- either of them can be either JSON or JSON-compatible YAML, on a document-by-document basis. |
|
Yes, and I just wanted to ask whether we should clarify that a yaml overlay can be used with a JSON openAPI document. That's because we have a similar clarification for yaml documents with JSON http request/- response bodies in oad |
|
@baywet OK I guess I'm just lost as I don't understand the concern for request/responses either. Requests/responses are whatever media type they are. It is completely irrelevant whether an OAD or Overlay is in JSON or YAML, because we restrict YAML to its JSON-compatible subset. It's like whether the text i UTF-8 or some other character set. It doesn't matter, it's below the level at which we care. YAML is just a convenience for authoring documents that are, fundamentally, JSON in terms of their data model and how they can be manipulated. |
|
@handrews I agree with you, I'm not sure why we need the format note in the OAI spec in the first place. But since it's there, I was asking whether we should have something similar in the context of overlay vs OAI description. |
ralfhandl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, Minor nit
Co-authored-by: Ralf Handl <[email protected]>
| In order to preserve the ability to round-trip between YAML and JSON formats, YAML version [1.2](https://yaml.org/spec/1.2/spec.html) is RECOMMENDED along with the additional constraints listed in [[!RFC9512]] [Section 3.4](https://www.rfc-editor.org/rfc/rfc9512.html#name-yaml-and-json). | ||
|
|
||
| The recommendation in previous versions of this specification to restrict YAML to its "JSON" [schema ruleset](https://yaml.org/spec/1.2/spec.html#id2803231) allowed for the inclusion of certain values that (despite the name) cannot be represented in JSON. | ||
| Overlay authors SHOULD NOT rely on any such JSON-incompatible YAML values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously we mentioned these as being tags and scalar keys. While I'm sure this reference is entirely correct and comprehensive, could we keep the high-level explanation as well to help people understand what kinds of things to look out for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lornajane this change brings it into alignment with OAS 3.2. The previous language was not only confusing but actually incorrect. Fortunately, almost no one paid attention to it. The part about tags was particularly baffling, IIRC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the important thing here is to use the same wording across all three specs.
Because it's completely independent of those other things mentioned in the OAS? The OAD (or Overlay document or Arazzo, etc.) needs to be either JSON or JSON-compatible YAML, and this section explains that. It has nothing at all to do with any API content whatsoever. |
fixes #236
This pull request aligns the format considerations with the language and structure used in OAI 3.2.0 for better consistency and understanding.
Key differences with 3.2.0 are:
Remaining questions: