Skip to content

Commit ed39e4a

Browse files
authored
Merge pull request #4331 from ralfhandl/v3.1-field-names-and-values-in-YAML-comments
2 parents d22d504 + 97e7b3d commit ed39e4a

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ Plus some suggestions, rather than rules:
214214
* property of a "plain" JSON object that is not an OpenAPI-defined Foo Object -> "property"
215215
* "attribute" is only used in the XML context and means "XML attribute"
216216

217+
### Field Names and Values in YAML comments
218+
219+
Field names and keywords should be in backticks.
220+
Values like "Dog" should be double quoted.
221+
217222
## Release Process and Scope
218223

219224
This section relates to the 3.x versions only.

src/oas.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ servers:
549549
- '443'
550550
default: '8443'
551551
basePath:
552-
# open meaning there is the opportunity to use special base paths as assigned by the provider, default is `v2`
552+
# open meaning there is the opportunity to use special base paths as assigned by the provider, default is "v2"
553553
default: v2
554554
```
555555
@@ -1746,8 +1746,8 @@ requestBody:
17461746
name:
17471747
type: string
17481748
icon:
1749-
# The default content type with "contentEncoding" present
1750-
# is application/octet-stream, so we need to set the correct
1749+
# The default content type with `contentEncoding` present
1750+
# is "application/octet-stream", so we need to set the correct
17511751
# image media type(s) in the Encoding Object.
17521752
type: string
17531753
contentEncoding: base64url
@@ -1802,18 +1802,18 @@ requestBody:
18021802
type: object
18031803
properties:
18041804
# default content type for a string without `contentEncoding`
1805-
# is `text/plain`
1805+
# is "text/plain"
18061806
id:
18071807
type: string
18081808
format: uuid
18091809

18101810
# default content type for a schema without `type`
1811-
# is `application/octet-stream`
1811+
# is "application/octet-stream"
18121812
profileImage: {}
18131813

18141814
# default content type for arrays is based on the type
18151815
# in the `items` subschema, which is an object here,
1816-
# so the default content type for each item is `application/json`
1816+
# so the default content type for each item is "application/json"
18171817
addresses:
18181818
type: array
18191819
items:
@@ -1832,13 +1832,13 @@ requestBody:
18321832
schema:
18331833
type: object
18341834
properties:
1835-
# No Encoding Object, so use default `text/plain`
1835+
# No Encoding Object, so use default "text/plain"
18361836
id:
18371837
type: string
18381838
format: uuid
18391839
1840-
# Encoding Object overrides the default `application/json` content type
1841-
# for each item in the array with `application/xml; charset=utf-8`
1840+
# Encoding Object overrides the default "application/json" content type
1841+
# for each item in the array with "application/xml; charset=utf-8"
18421842
addresses:
18431843
description: addresses in XML format
18441844
type: array
@@ -1871,7 +1871,7 @@ requestBody:
18711871
multipart/form-data:
18721872
schema:
18731873
properties:
1874-
# The property name 'file' will be used for all files.
1874+
# The property name `file` will be used for all files.
18751875
file:
18761876
type: array
18771877
items: {}
@@ -2425,7 +2425,7 @@ paths:
24252425
# the target link operationId
24262426
operationId: getUserAddress
24272427
parameters:
2428-
# get the `id` field from the request path parameter named `id`
2428+
# use the value of the request path parameter named "id"
24292429
userid: $request.path.id
24302430
# the path item of the linked operation
24312431
/users/{userid}/address:
@@ -2453,7 +2453,7 @@ links:
24532453
address:
24542454
operationId: getUserAddressByUUID
24552455
parameters:
2456-
# get the `uuid` field from the `uuid` field in the response body
2456+
# use the value of the `uuid` field in the response body
24572457
userUuid: $response.body#/uuid
24582458
```
24592459
@@ -2469,7 +2469,6 @@ field in an [Operation Object](#operation-object)), references MAY also be made
24692469
```yaml
24702470
links:
24712471
UserRepositories:
2472-
# returns array of '#/components/schemas/repository'
24732472
operationRef: '#/paths/~12.0~1repositories~1%7Busername%7D/get'
24742473
parameters:
24752474
username: $response.body#/username
@@ -2480,7 +2479,6 @@ or a URI `operationRef`:
24802479
```yaml
24812480
links:
24822481
UserRepositories:
2483-
# returns array of '#/components/schemas/repository'
24842482
operationRef: https://na2.gigantic-server.com/#/paths/~12.0~1repositories~1%7Busername%7D/get
24852483
parameters:
24862484
username: $response.body#/username
@@ -3396,23 +3394,23 @@ components:
33963394
allOf:
33973395
- $ref: '#/components/schemas/Pet'
33983396
- type: object
3399-
# all other properties specific to a `Cat`
3397+
# all other properties specific to a "Cat"
34003398
properties:
34013399
name:
34023400
type: string
34033401
Dog:
34043402
allOf:
34053403
- $ref: '#/components/schemas/Pet'
34063404
- type: object
3407-
# all other properties specific to a `Dog`
3405+
# all other properties specific to a "Dog"
34083406
properties:
34093407
bark:
34103408
type: string
34113409
Lizard:
34123410
allOf:
34133411
- $ref: '#/components/schemas/Pet'
34143412
- type: object
3415-
# all other properties specific to a `Lizard`
3413+
# all other properties specific to a "Lizard"
34163414
properties:
34173415
lovesRocks:
34183416
type: boolean

0 commit comments

Comments
 (0)