Skip to content

Commit ab71df8

Browse files
whitespace and quoting fixes in json and yaml examples
1 parent 6f60ea1 commit ab71df8

File tree

1 file changed

+68
-69
lines changed

1 file changed

+68
-69
lines changed

versions/3.2.0.md

+68-69
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ components:
644644
in: header
645645
petstore_auth:
646646
type: oauth2
647-
flows:
647+
flows:
648648
implicit:
649649
authorizationUrl: https://example.org/api/oauth/dialog
650650
scopes:
@@ -696,7 +696,7 @@ The following may lead to ambiguous resolution:
696696
"get": {
697697
"description": "Returns all pets from the system that the user has access to",
698698
"responses": {
699-
"200": {
699+
"200": {
700700
"description": "A list of pets.",
701701
"content": {
702702
"application/json": {
@@ -836,7 +836,7 @@ parameters:
836836
schema:
837837
type: array
838838
items:
839-
type: string
839+
type: string
840840
style: simple
841841
```
842842

@@ -889,7 +889,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens
889889
"schema": {
890890
"type": "object",
891891
"properties": {
892-
"name": {
892+
"name": {
893893
"description": "Updated name of the pet",
894894
"type": "string"
895895
},
@@ -898,7 +898,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens
898898
"type": "string"
899899
}
900900
},
901-
"required": ["status"]
901+
"required": ["status"]
902902
}
903903
}
904904
}
@@ -944,11 +944,11 @@ parameters:
944944
type: string
945945
requestBody:
946946
content:
947-
'application/x-www-form-urlencoded':
947+
application/x-www-form-urlencoded:
948948
schema:
949949
type: object
950950
properties:
951-
name:
951+
name:
952952
description: Updated name of the pet
953953
type: string
954954
status:
@@ -959,14 +959,14 @@ requestBody:
959959
responses:
960960
'200':
961961
description: Pet updated.
962-
content:
963-
'application/json': {}
964-
'application/xml': {}
962+
content:
963+
application/json: {}
964+
application/xml: {}
965965
'405':
966966
description: Method Not Allowed
967-
content:
968-
'application/json': {}
969-
'application/xml': {}
967+
content:
968+
application/json: {}
969+
application/xml: {}
970970
security:
971971
- petstore_auth:
972972
- write:pets
@@ -1271,36 +1271,36 @@ A request body with a referenced model definition.
12711271
"$ref": "#/components/schemas/User"
12721272
},
12731273
"examples": {
1274-
"user" : {
1275-
"summary": "User Example",
1276-
"externalValue": "https://foo.bar/examples/user-example.json"
1277-
}
1274+
"user" : {
1275+
"summary": "User Example",
1276+
"externalValue": "https://foo.bar/examples/user-example.json"
12781277
}
1278+
}
12791279
},
12801280
"application/xml": {
12811281
"schema": {
12821282
"$ref": "#/components/schemas/User"
12831283
},
12841284
"examples": {
1285-
"user" : {
1286-
"summary": "User example in XML",
1287-
"externalValue": "https://foo.bar/examples/user-example.xml"
1288-
}
1285+
"user" : {
1286+
"summary": "User example in XML",
1287+
"externalValue": "https://foo.bar/examples/user-example.xml"
12891288
}
1289+
}
12901290
},
12911291
"text/plain": {
12921292
"examples": {
12931293
"user" : {
12941294
"summary": "User example in Plain text",
1295-
"externalValue": "https://foo.bar/examples/user-example.txt"
1295+
"externalValue": "https://foo.bar/examples/user-example.txt"
12961296
}
1297-
}
1297+
}
12981298
},
12991299
"*/*": {
13001300
"examples": {
13011301
"user" : {
1302-
"summary": "User example in other format",
1303-
"externalValue": "https://foo.bar/examples/user-example.whatever"
1302+
"summary": "User example in other format",
1303+
"externalValue": "https://foo.bar/examples/user-example.whatever"
13041304
}
13051305
}
13061306
}
@@ -1310,29 +1310,29 @@ A request body with a referenced model definition.
13101310

13111311
```yaml
13121312
description: user to add to the system
1313-
content:
1314-
'application/json':
1313+
content:
1314+
application/json:
13151315
schema:
13161316
$ref: '#/components/schemas/User'
13171317
examples:
13181318
user:
13191319
summary: User Example
13201320
externalValue: 'https://foo.bar/examples/user-example.json'
1321-
'application/xml':
1321+
application/xml:
13221322
schema:
13231323
$ref: '#/components/schemas/User'
13241324
examples:
13251325
user:
13261326
summary: User example in XML
13271327
externalValue: 'https://foo.bar/examples/user-example.xml'
1328-
'text/plain':
1328+
text/plain:
13291329
examples:
13301330
user:
13311331
summary: User example in Plain text
13321332
externalValue: 'https://foo.bar/examples/user-example.txt'
13331333
'*/*':
13341334
examples:
1335-
user:
1335+
user:
13361336
summary: User example in other format
13371337
externalValue: 'https://foo.bar/examples/user-example.whatever'
13381338
```
@@ -1386,30 +1386,29 @@ This object MAY be extended with [Specification Extensions](#specificationExtens
13861386
{
13871387
"application/json": {
13881388
"schema": {
1389-
"$ref": "#/components/schemas/Pet"
1389+
"$ref": "#/components/schemas/Pet"
13901390
},
13911391
"examples": {
13921392
"cat" : {
13931393
"summary": "An example of a cat",
1394-
"value":
1395-
{
1396-
"name": "Fluffy",
1397-
"petType": "Cat",
1398-
"color": "White",
1399-
"gender": "male",
1400-
"breed": "Persian"
1401-
}
1394+
"value": {
1395+
"name": "Fluffy",
1396+
"petType": "Cat",
1397+
"color": "White",
1398+
"gender": "male",
1399+
"breed": "Persian"
1400+
}
14021401
},
14031402
"dog": {
14041403
"summary": "An example of a dog with a cat's name",
1405-
"value" : {
1404+
"value" : {
14061405
"name": "Puma",
14071406
"petType": "Dog",
14081407
"color": "Black",
14091408
"gender": "Female",
14101409
"breed": "Mixed"
14111410
},
1412-
"frog": {
1411+
"frog": {
14131412
"$ref": "#/components/examples/frog-example"
14141413
}
14151414
}
@@ -1419,7 +1418,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens
14191418
```
14201419

14211420
```yaml
1422-
application/json:
1421+
application/json:
14231422
schema:
14241423
$ref: "#/components/schemas/Pet"
14251424
examples:
@@ -1458,24 +1457,24 @@ Content transferred in binary (octet-stream) MAY omit `schema`:
14581457
```yaml
14591458
# a PNG image as a binary file:
14601459
content:
1461-
image/png: {}
1460+
image/png: {}
14621461
```
14631462

14641463
```yaml
14651464
# an arbitrary binary file:
14661465
content:
1467-
application/octet-stream: {}
1466+
application/octet-stream: {}
14681467
```
14691468

14701469
Binary content transferred with base64 encoding:
14711470

14721471
```yaml
14731472
content:
1474-
image/png:
1475-
schema:
1476-
type: string
1477-
contentMediaType: image/png
1478-
contentEncoding: base64
1473+
image/png:
1474+
schema:
1475+
type: string
1476+
contentMediaType: image/png
1477+
contentEncoding: base64
14791478
```
14801479

14811480
Note that the `Content-Type` remains `image/png`, describing the semantics of the payload. The JSON Schema `type` and `contentEncoding` fields explain that the payload is transferred as text. The JSON Schema `contentMediaType` is technically redundant, but can be used by JSON Schema tools that may not be aware of the OpenAPI context.
@@ -1704,7 +1703,7 @@ A 200 response for a successful operation and a default response for others (imp
17041703
```yaml
17051704
'200':
17061705
description: a pet to be returned
1707-
content:
1706+
content:
17081707
application/json:
17091708
schema:
17101709
$ref: '#/components/schemas/Pet'
@@ -1752,9 +1751,9 @@ Response of an array of a complex type:
17521751

17531752
```yaml
17541753
description: A complex object array response
1755-
content:
1754+
content:
17561755
application/json:
1757-
schema:
1756+
schema:
17581757
type: array
17591758
items:
17601759
$ref: '#/components/schemas/VeryComplexType'
@@ -1890,7 +1889,7 @@ Content-Length: 187
18901889
"https://clientdomain.com/fast",
18911890
"https://clientdomain.com/medium",
18921891
"https://clientdomain.com/slow"
1893-
]
1892+
]
18941893
}
18951894
18961895
201 Created
@@ -1939,7 +1938,7 @@ transactionCallback:
19391938
requestBody:
19401939
description: Callback payload
19411940
content:
1942-
'application/json':
1941+
application/json:
19431942
schema:
19441943
$ref: '#/components/schemas/SomePayload'
19451944
responses:
@@ -1973,21 +1972,21 @@ requestBody:
19731972
'application/json':
19741973
schema:
19751974
$ref: '#/components/schemas/Address'
1976-
examples:
1975+
examples:
19771976
foo:
19781977
summary: A foo example
19791978
value: {"foo": "bar"}
19801979
bar:
19811980
summary: A bar example
19821981
value: {"bar": "baz"}
1983-
'application/xml':
1984-
examples:
1982+
application/xml:
1983+
examples:
19851984
xmlExample:
19861985
summary: This is an example in XML
19871986
externalValue: 'https://example.org/examples/address-example.xml'
1988-
'text/plain':
1987+
text/plain:
19891988
examples:
1990-
textExample:
1989+
textExample:
19911990
summary: This is a text example
19921991
externalValue: 'https://foo.bar/examples/address-example.txt'
19931992
```
@@ -1996,13 +1995,13 @@ In a parameter:
19961995

19971996
```yaml
19981997
parameters:
1999-
- name: 'zipCode'
2000-
in: 'query'
1998+
- name: zipCode
1999+
in: query
20012000
schema:
2002-
type: 'string'
2003-
format: 'zip-code'
2001+
type: string
2002+
format: zip-code
20042003
examples:
2005-
zip-example:
2004+
zip-example:
20062005
$ref: '#/components/examples/zip-example'
20072006
```
20082007

@@ -2012,7 +2011,7 @@ In a response:
20122011
responses:
20132012
'200':
20142013
description: your car appointment has been booked
2015-
content:
2014+
content:
20162015
application/json:
20172016
schema:
20182017
$ref: '#/components/schemas/SuccessResponse'
@@ -2060,7 +2059,7 @@ paths:
20602059
- name: id
20612060
in: path
20622061
required: true
2063-
description: the user identifier, as userId
2062+
description: the user identifier, as userId
20642063
schema:
20652064
type: string
20662065
get:
@@ -2088,7 +2087,7 @@ paths:
20882087
- name: userid
20892088
in: path
20902089
required: true
2091-
description: the user identifier, as userId
2090+
description: the user identifier, as userId
20922091
schema:
20932092
type: string
20942093
# linked operation
@@ -3337,7 +3336,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens
33373336

33383337
```yaml
33393338
type: oauth2
3340-
flows:
3339+
flows:
33413340
implicit:
33423341
authorizationUrl: https://example.com/api/oauth/dialog
33433342
scopes:
@@ -3348,7 +3347,7 @@ flows:
33483347
tokenUrl: https://example.com/api/oauth/token
33493348
scopes:
33503349
write:pets: modify pets in your account
3351-
read:pets: read your pets
3350+
read:pets: read your pets
33523351
```
33533352

33543353
#### <a name="securityRequirementObject"></a>Security Requirement Object

0 commit comments

Comments
 (0)