Skip to content

Commit 454ba92

Browse files
committed
Simplify the JSON/YAML stuff
We don't really need the stuff about character encodings, as it was there because I was confused about something else. Also minimize the explanation of the change.
1 parent 97d8c94 commit 454ba92

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/oas.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -175,16 +175,8 @@ Patterned fields MUST have unique names within the containing object.
175175

176176
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).
177177

178-
Previous versions of this specification expressed this requirement in terms of [YAML's JSON schema ruleset](https://yaml.org/spec/1.2/spec.html#id2803231), which defines a subset of the YAML syntax and is unrelated to [[JSON-Schema-2020-12|JSON Schema]].
179-
Despite its name, this ruleset supports features that are not part of JSON, such as distinguishing between integers and floats (see [Data Types](#data-types)) or supporting `!!float .nan` as a value.
180-
OAD authors SHOULD NOT rely on any YAML features supported by YAML's JSON schema ruleset that are listed as having interoperability challenges in RFC9512.
181-
182-
#### Character Encoding
183-
184-
Note that as stated in [[RFC8259|JSON]] [Section 8.1](https://www.rfc-editor.org/rfc/rfc8259.html#section-8.1), only JSON encoded using UTF-8 is interoperable, which is extended to JSON-compatible YAML in [[!RFC9512]] [Section 3.4](https://www.rfc-editor.org/rfc/rfc9512.html#name-yaml-and-json).
185-
186-
This specification assumes that all OADs are encoded using UTF-8.
187-
If an implementation chooses to support additional character encodings, the behavior of any feature relying on the assumption of UTF-8 encoding is implementation-defined.
178+
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.
179+
OAD authors SHOULD NOT rely on any such JSON-incompatible YAML values.
188180

189181
### OpenAPI Description Structure
190182

0 commit comments

Comments
 (0)