Skip to content

Conversation

@baywet
Copy link
Member

@baywet baywet commented Nov 20, 2025

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:

  1. I removed the comment about HTTP case sensitivity since it does not really apply here.
  2. I removed the note about API requests and responses bodies formats in relation with the document format since it doesn't really apply here.
  3. Updated any mention of "OpenAPI" to "Overlay".

Remaining questions:

  1. Should we have a note to say that the format of the OpenAPI and Overlay documents MAY be different?

@handrews
Copy link
Member

@baywet

Should we have a note to say that the format of the OpenAPI and Overlay documents MAY be different?

What do you mean by this exactly?

@baywet
Copy link
Member Author

baywet commented Nov 20, 2025

@baywet

Should we have a note to say that the format of the OpenAPI and Overlay documents MAY be different?

What do you mean by this exactly?

@handrews I mean that it's not because your Overlay is in YAML that your OpenAPI description MUST be in YAML, and vice versa

@handrews
Copy link
Member

@baywet now I'm even more confused- either of them can be either JSON or JSON-compatible YAML, on a document-by-document basis.

@baywet
Copy link
Member Author

baywet commented Nov 20, 2025

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

@handrews
Copy link
Member

@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.

@baywet
Copy link
Member Author

baywet commented Nov 20, 2025

@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.

Copy link
Contributor

@ralfhandl ralfhandl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, Minor nit

@ralfhandl ralfhandl requested a review from a team November 23, 2025 17:27
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.
Copy link
Contributor

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?

Copy link
Member

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.

Copy link
Member

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.

@handrews
Copy link
Member

handrews commented Nov 23, 2025

@baywet

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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Align statement on JSON-YAML round-tripping with OpenAPI specification?

4 participants