Skip to content

Commit a48949c

Browse files
authored
Change response codes to strings (#1112) (#1990)
Fixes #1112 . Changes proposed in this pull request: - Convert response keys from ints to strings
1 parent e6d1234 commit a48949c

File tree

37 files changed

+158
-158
lines changed

37 files changed

+158
-158
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ The operation described in your specification is automatically linked to your Py
169169
post:
170170
operationId: run.post_greeting
171171
responses:
172-
200:
172+
'200':
173173
content:
174174
text/plain:
175175
schema:

docs/quickstart.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ register an API defined by an OpenAPI (or Swagger) specification.
142142
post:
143143
operationId: run.post_greeting
144144
responses:
145-
200:
145+
'200':
146146
description: "Greeting response"
147147
content:
148148
text/plain:

examples/basicauth/spec/swagger.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ paths:
99
summary: Return secret string
1010
operationId: app.get_secret
1111
responses:
12-
200:
12+
'200':
1313
description: secret response
1414
schema:
1515
type: string

examples/frameworks/spec/openapi.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ paths:
1313
description: Generates a greeting message.
1414
operationId: post_greeting
1515
responses:
16-
200:
16+
'200':
1717
description: greeting response
1818
content:
1919
text/plain:

examples/frameworks/spec/swagger.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ paths:
1515
produces:
1616
- text/plain;
1717
responses:
18-
200:
18+
'200':
1919
description: greeting response
2020
schema:
2121
type: string

examples/helloworld/spec/openapi.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ paths:
1313
description: Generates a greeting message.
1414
operationId: hello.post_greeting
1515
responses:
16-
200:
16+
'200':
1717
description: greeting response
1818
content:
1919
text/plain:

examples/helloworld/spec/swagger.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ paths:
1515
produces:
1616
- text/plain;
1717
responses:
18-
200:
18+
'200':
1919
description: greeting response
2020
schema:
2121
type: string

examples/helloworld_async/spec/openapi.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ paths:
1313
description: Generates a greeting message.
1414
operationId: hello.post_greeting
1515
responses:
16-
200:
16+
'200':
1717
description: greeting response
1818
content:
1919
text/plain:

examples/helloworld_async/spec/swagger.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ paths:
1212
description: Generates a greeting message.
1313
operationId: hello.post_greeting
1414
responses:
15-
200:
15+
'200':
1616
description: greeting response
1717
schema:
1818
type: string

examples/oauth2/spec/mock_tokeninfo.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ paths:
1010
summary: OAuth2 token info
1111
operationId: mock_tokeninfo.get_tokeninfo
1212
responses:
13-
200:
13+
'200':
1414
description: Token info object
1515
schema:
1616
type: object

examples/oauth2/spec/openapi.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ paths:
1313
summary: Return secret string
1414
operationId: app.get_secret
1515
responses:
16-
200:
16+
'200':
1717
description: secret response
1818
content:
1919
'text/plain':

examples/oauth2/spec/swagger.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ paths:
1212
summary: Return secret string
1313
operationId: app.get_secret
1414
responses:
15-
200:
15+
'200':
1616
description: secret response
1717
schema:
1818
type: string

examples/oauth2_local_tokeninfo/spec/openapi.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ paths:
1313
summary: Return secret string
1414
operationId: app.get_secret
1515
responses:
16-
200:
16+
'200':
1717
description: secret response
1818
content:
1919
text/plain:

examples/oauth2_local_tokeninfo/spec/swagger.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ paths:
1212
summary: Return secret string
1313
operationId: app.get_secret
1414
responses:
15-
200:
15+
'200':
1616
description: secret response
1717
schema:
1818
type: string

examples/sqlalchemy/spec/swagger.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ paths:
2424
minimum: 0
2525
default: 100
2626
responses:
27-
200:
27+
'200':
2828
description: Return pets
2929
schema:
3030
type: array
@@ -38,11 +38,11 @@ paths:
3838
parameters:
3939
- $ref: '#/parameters/pet_id'
4040
responses:
41-
200:
41+
'200':
4242
description: Return pet
4343
schema:
4444
$ref: '#/definitions/Pet'
45-
404:
45+
'404':
4646
description: Pet does not exist
4747
put:
4848
tags: [Pets]
@@ -55,9 +55,9 @@ paths:
5555
schema:
5656
$ref: '#/definitions/Pet'
5757
responses:
58-
200:
58+
'200':
5959
description: Pet updated
60-
201:
60+
'201':
6161
description: New pet created
6262
delete:
6363
tags: [Pets]
@@ -66,9 +66,9 @@ paths:
6666
parameters:
6767
- $ref: '#/parameters/pet_id'
6868
responses:
69-
204:
69+
'204':
7070
description: Pet was deleted
71-
404:
71+
'404':
7272
description: Pet does not exist
7373

7474

tests/fixtures/bad_operations/swagger.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ paths:
1111
get:
1212
operationId: no.module.or.function
1313
responses:
14-
200:
14+
'200':
1515
description: greeting response
1616
schema:
1717
type: object
1818
put:
1919
# operationId: XXX completely missing
2020
responses:
21-
200:
21+
'200':
2222
description: greeting response
2323
schema:
2424
type: object
2525
post:
2626
operationId: fakeapi.module_with_error.something
2727
responses:
28-
200:
28+
'200':
2929
description: greeting response
3030
schema:
3131
type: object

tests/fixtures/bad_specs/swagger.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ paths:
1717
type: integer
1818
default: somestring
1919
responses:
20-
200:
20+
'200':
2121
description: search
2222
schema:
2323
type: object

tests/fixtures/datetime_support/openapi.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ paths:
1212
summary: Generate data with date time
1313
operationId: fakeapi.hello.get_datetime
1414
responses:
15-
200:
15+
'200':
1616
description: date time example
1717
content:
1818
application/json:
@@ -29,7 +29,7 @@ paths:
2929
summary: Generate data with date
3030
operationId: fakeapi.hello.get_date
3131
responses:
32-
200:
32+
'200':
3333
description: date example
3434
content:
3535
application/json:
@@ -46,7 +46,7 @@ paths:
4646
summary: Generate data with uuid
4747
operationId: fakeapi.hello.get_uuid
4848
responses:
49-
200:
49+
'200':
5050
description: uuid example
5151
content:
5252
application/json:

tests/fixtures/datetime_support/swagger.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ paths:
1111
get:
1212
operationId: fakeapi.hello.get_datetime
1313
responses:
14-
200:
14+
'200':
1515
description: date time example
1616
schema:
1717
type: object
@@ -25,7 +25,7 @@ paths:
2525
get:
2626
operationId: fakeapi.hello.get_date
2727
responses:
28-
200:
28+
'200':
2929
description: date example
3030
schema:
3131
type: object
@@ -40,7 +40,7 @@ paths:
4040
summary: Generate data with uuid
4141
operationId: fakeapi.hello.get_uuid
4242
responses:
43-
200:
43+
'200':
4444
description: uuid example
4545
schema:
4646
type: object

tests/fixtures/default_param_error/swagger.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ paths:
1212
summary: Default value does not match the param type
1313
operationId: fakeapi.hello.test_default_mismatch_definition
1414
responses:
15-
200:
15+
'200':
1616
description: OK
1717
parameters:
1818
- name: age

0 commit comments

Comments
 (0)