Skip to content

Commit 6d25b12

Browse files
committed
Merge pull request #635 from OAI/issue-575
clarification about YAML
2 parents baf1061 + 3720cb4 commit 6d25b12

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

versions/3.0.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The HTTP Status Codes are used to indicate the status of the executed operation.
5151
### Format
5252

5353
The files describing the RESTful API in accordance with the OpenAPI Specification are represented as JSON objects and conform to the JSON standards. YAML, being a superset of JSON, can be used as well to
54-
represent a OAS (OpenAPI Specification) file.
54+
represent a OAS (OpenAPI Specification) file.
5555

5656
For example, if a field is said to have an array value, the JSON array representation will be used:
5757

@@ -67,6 +67,11 @@ All field names in the specification are **case sensitive**.
6767

6868
The schema exposes two types of fields. Fixed fields, which have a declared name, and Patterned fields, which declare a regex pattern for the field name. Patterned fields can have multiple occurrences as long as each has a unique name.
6969

70+
In order to preserve the ability to round-trip between YAML and JSON formats, YAML version [1.2](http://www.yaml.org/spec/1.2/spec.html) is recommended along with some additional constraints:
71+
72+
- Tags MUST be limited to those allowed by the [JSON Schema ruleset](http://www.yaml.org/spec/1.2/spec.html#id2803231)
73+
- Keys used in YAML maps MUST be limited to a scalar string, as defined by the YAML Failsafe schema ruleset
74+
7075
### File Structure
7176

7277
The OAS representation of the API is made of a single file. However, parts of the definitions can be split into separate files, at the discretion of the user. This is applicable for `$ref` fields in the specification as follows from the [JSON Schema](http://json-schema.org) definitions.

0 commit comments

Comments
 (0)