Skip to content

Commit 45b8936

Browse files
whitespace and quoting fixes in json and yaml examples
1 parent e48bf46 commit 45b8936

File tree

1 file changed

+68
-69
lines changed

1 file changed

+68
-69
lines changed

versions/3.1.1.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": {
@@ -837,7 +837,7 @@ parameters:
837837
schema:
838838
type: array
839839
items:
840-
type: string
840+
type: string
841841
style: simple
842842
```
843843

@@ -890,7 +890,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens
890890
"schema": {
891891
"type": "object",
892892
"properties": {
893-
"name": {
893+
"name": {
894894
"description": "Updated name of the pet",
895895
"type": "string"
896896
},
@@ -899,7 +899,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens
899899
"type": "string"
900900
}
901901
},
902-
"required": ["status"]
902+
"required": ["status"]
903903
}
904904
}
905905
}
@@ -945,11 +945,11 @@ parameters:
945945
type: string
946946
requestBody:
947947
content:
948-
'application/x-www-form-urlencoded':
948+
application/x-www-form-urlencoded:
949949
schema:
950950
type: object
951951
properties:
952-
name:
952+
name:
953953
description: Updated name of the pet
954954
type: string
955955
status:
@@ -960,14 +960,14 @@ requestBody:
960960
responses:
961961
'200':
962962
description: Pet updated.
963-
content:
964-
'application/json': {}
965-
'application/xml': {}
963+
content:
964+
application/json: {}
965+
application/xml: {}
966966
'405':
967967
description: Method Not Allowed
968-
content:
969-
'application/json': {}
970-
'application/xml': {}
968+
content:
969+
application/json: {}
970+
application/xml: {}
971971
security:
972972
- petstore_auth:
973973
- write:pets
@@ -1272,36 +1272,36 @@ A request body with a referenced model definition.
12721272
"$ref": "#/components/schemas/User"
12731273
},
12741274
"examples": {
1275-
"user" : {
1276-
"summary": "User Example",
1277-
"externalValue": "https://foo.bar/examples/user-example.json"
1278-
}
1275+
"user" : {
1276+
"summary": "User Example",
1277+
"externalValue": "https://foo.bar/examples/user-example.json"
12791278
}
1279+
}
12801280
},
12811281
"application/xml": {
12821282
"schema": {
12831283
"$ref": "#/components/schemas/User"
12841284
},
12851285
"examples": {
1286-
"user" : {
1287-
"summary": "User example in XML",
1288-
"externalValue": "https://foo.bar/examples/user-example.xml"
1289-
}
1286+
"user" : {
1287+
"summary": "User example in XML",
1288+
"externalValue": "https://foo.bar/examples/user-example.xml"
12901289
}
1290+
}
12911291
},
12921292
"text/plain": {
12931293
"examples": {
12941294
"user" : {
12951295
"summary": "User example in Plain text",
1296-
"externalValue": "https://foo.bar/examples/user-example.txt"
1296+
"externalValue": "https://foo.bar/examples/user-example.txt"
12971297
}
1298-
}
1298+
}
12991299
},
13001300
"*/*": {
13011301
"examples": {
13021302
"user" : {
1303-
"summary": "User example in other format",
1304-
"externalValue": "https://foo.bar/examples/user-example.whatever"
1303+
"summary": "User example in other format",
1304+
"externalValue": "https://foo.bar/examples/user-example.whatever"
13051305
}
13061306
}
13071307
}
@@ -1311,29 +1311,29 @@ A request body with a referenced model definition.
13111311

13121312
```yaml
13131313
description: user to add to the system
1314-
content:
1315-
'application/json':
1314+
content:
1315+
application/json:
13161316
schema:
13171317
$ref: '#/components/schemas/User'
13181318
examples:
13191319
user:
13201320
summary: User Example
13211321
externalValue: 'https://foo.bar/examples/user-example.json'
1322-
'application/xml':
1322+
application/xml:
13231323
schema:
13241324
$ref: '#/components/schemas/User'
13251325
examples:
13261326
user:
13271327
summary: User example in XML
13281328
externalValue: 'https://foo.bar/examples/user-example.xml'
1329-
'text/plain':
1329+
text/plain:
13301330
examples:
13311331
user:
13321332
summary: User example in Plain text
13331333
externalValue: 'https://foo.bar/examples/user-example.txt'
13341334
'*/*':
13351335
examples:
1336-
user:
1336+
user:
13371337
summary: User example in other format
13381338
externalValue: 'https://foo.bar/examples/user-example.whatever'
13391339
```
@@ -1387,30 +1387,29 @@ This object MAY be extended with [Specification Extensions](#specificationExtens
13871387
{
13881388
"application/json": {
13891389
"schema": {
1390-
"$ref": "#/components/schemas/Pet"
1390+
"$ref": "#/components/schemas/Pet"
13911391
},
13921392
"examples": {
13931393
"cat" : {
13941394
"summary": "An example of a cat",
1395-
"value":
1396-
{
1397-
"name": "Fluffy",
1398-
"petType": "Cat",
1399-
"color": "White",
1400-
"gender": "male",
1401-
"breed": "Persian"
1402-
}
1395+
"value": {
1396+
"name": "Fluffy",
1397+
"petType": "Cat",
1398+
"color": "White",
1399+
"gender": "male",
1400+
"breed": "Persian"
1401+
}
14031402
},
14041403
"dog": {
14051404
"summary": "An example of a dog with a cat's name",
1406-
"value" : {
1405+
"value" : {
14071406
"name": "Puma",
14081407
"petType": "Dog",
14091408
"color": "Black",
14101409
"gender": "Female",
14111410
"breed": "Mixed"
14121411
},
1413-
"frog": {
1412+
"frog": {
14141413
"$ref": "#/components/examples/frog-example"
14151414
}
14161415
}
@@ -1420,7 +1419,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens
14201419
```
14211420

14221421
```yaml
1423-
application/json:
1422+
application/json:
14241423
schema:
14251424
$ref: "#/components/schemas/Pet"
14261425
examples:
@@ -1459,24 +1458,24 @@ Content transferred in binary (octet-stream) MAY omit `schema`:
14591458
```yaml
14601459
# a PNG image as a binary file:
14611460
content:
1462-
image/png: {}
1461+
image/png: {}
14631462
```
14641463

14651464
```yaml
14661465
# an arbitrary binary file:
14671466
content:
1468-
application/octet-stream: {}
1467+
application/octet-stream: {}
14691468
```
14701469

14711470
Binary content transferred with base64 encoding:
14721471

14731472
```yaml
14741473
content:
1475-
image/png:
1476-
schema:
1477-
type: string
1478-
contentMediaType: image/png
1479-
contentEncoding: base64
1474+
image/png:
1475+
schema:
1476+
type: string
1477+
contentMediaType: image/png
1478+
contentEncoding: base64
14801479
```
14811480

14821481
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.
@@ -1705,7 +1704,7 @@ A 200 response for a successful operation and a default response for others (imp
17051704
```yaml
17061705
'200':
17071706
description: a pet to be returned
1708-
content:
1707+
content:
17091708
application/json:
17101709
schema:
17111710
$ref: '#/components/schemas/Pet'
@@ -1753,9 +1752,9 @@ Response of an array of a complex type:
17531752

17541753
```yaml
17551754
description: A complex object array response
1756-
content:
1755+
content:
17571756
application/json:
1758-
schema:
1757+
schema:
17591758
type: array
17601759
items:
17611760
$ref: '#/components/schemas/VeryComplexType'
@@ -1891,7 +1890,7 @@ Content-Length: 187
18911890
"https://clientdomain.com/fast",
18921891
"https://clientdomain.com/medium",
18931892
"https://clientdomain.com/slow"
1894-
]
1893+
]
18951894
}
18961895
18971896
201 Created
@@ -1940,7 +1939,7 @@ transactionCallback:
19401939
requestBody:
19411940
description: Callback payload
19421941
content:
1943-
'application/json':
1942+
application/json:
19441943
schema:
19451944
$ref: '#/components/schemas/SomePayload'
19461945
responses:
@@ -1974,21 +1973,21 @@ requestBody:
19741973
'application/json':
19751974
schema:
19761975
$ref: '#/components/schemas/Address'
1977-
examples:
1976+
examples:
19781977
foo:
19791978
summary: A foo example
19801979
value: {"foo": "bar"}
19811980
bar:
19821981
summary: A bar example
19831982
value: {"bar": "baz"}
1984-
'application/xml':
1985-
examples:
1983+
application/xml:
1984+
examples:
19861985
xmlExample:
19871986
summary: This is an example in XML
19881987
externalValue: 'https://example.org/examples/address-example.xml'
1989-
'text/plain':
1988+
text/plain:
19901989
examples:
1991-
textExample:
1990+
textExample:
19921991
summary: This is a text example
19931992
externalValue: 'https://foo.bar/examples/address-example.txt'
19941993
```
@@ -1997,13 +1996,13 @@ In a parameter:
19971996

19981997
```yaml
19991998
parameters:
2000-
- name: 'zipCode'
2001-
in: 'query'
1999+
- name: zipCode
2000+
in: query
20022001
schema:
2003-
type: 'string'
2004-
format: 'zip-code'
2002+
type: string
2003+
format: zip-code
20052004
examples:
2006-
zip-example:
2005+
zip-example:
20072006
$ref: '#/components/examples/zip-example'
20082007
```
20092008

@@ -2013,7 +2012,7 @@ In a response:
20132012
responses:
20142013
'200':
20152014
description: your car appointment has been booked
2016-
content:
2015+
content:
20172016
application/json:
20182017
schema:
20192018
$ref: '#/components/schemas/SuccessResponse'
@@ -2061,7 +2060,7 @@ paths:
20612060
- name: id
20622061
in: path
20632062
required: true
2064-
description: the user identifier, as userId
2063+
description: the user identifier, as userId
20652064
schema:
20662065
type: string
20672066
get:
@@ -2089,7 +2088,7 @@ paths:
20892088
- name: userid
20902089
in: path
20912090
required: true
2092-
description: the user identifier, as userId
2091+
description: the user identifier, as userId
20932092
schema:
20942093
type: string
20952094
# linked operation
@@ -3335,7 +3334,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens
33353334

33363335
```yaml
33373336
type: oauth2
3338-
flows:
3337+
flows:
33393338
implicit:
33403339
authorizationUrl: https://example.com/api/oauth/dialog
33413340
scopes:
@@ -3346,7 +3345,7 @@ flows:
33463345
tokenUrl: https://example.com/api/oauth/token
33473346
scopes:
33483347
write:pets: modify pets in your account
3349-
read:pets: read your pets
3348+
read:pets: read your pets
33503349
```
33513350

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

0 commit comments

Comments
 (0)