Skip to content

Commit

Permalink
Change response codes to strings (#1112) (#1990)
Browse files Browse the repository at this point in the history
Fixes #1112  .



Changes proposed in this pull request:

 - Convert response keys from ints to strings
  • Loading branch information
peso authored Nov 9, 2024
1 parent e6d1234 commit a48949c
Show file tree
Hide file tree
Showing 37 changed files with 158 additions and 158 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ The operation described in your specification is automatically linked to your Py
post:
operationId: run.post_greeting
responses:
200:
'200':
content:
text/plain:
schema:
Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ register an API defined by an OpenAPI (or Swagger) specification.
post:
operationId: run.post_greeting
responses:
200:
'200':
description: "Greeting response"
content:
text/plain:
Expand Down
2 changes: 1 addition & 1 deletion examples/basicauth/spec/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ paths:
summary: Return secret string
operationId: app.get_secret
responses:
200:
'200':
description: secret response
schema:
type: string
Expand Down
2 changes: 1 addition & 1 deletion examples/frameworks/spec/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ paths:
description: Generates a greeting message.
operationId: post_greeting
responses:
200:
'200':
description: greeting response
content:
text/plain:
Expand Down
2 changes: 1 addition & 1 deletion examples/frameworks/spec/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ paths:
produces:
- text/plain;
responses:
200:
'200':
description: greeting response
schema:
type: string
Expand Down
2 changes: 1 addition & 1 deletion examples/helloworld/spec/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ paths:
description: Generates a greeting message.
operationId: hello.post_greeting
responses:
200:
'200':
description: greeting response
content:
text/plain:
Expand Down
2 changes: 1 addition & 1 deletion examples/helloworld/spec/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ paths:
produces:
- text/plain;
responses:
200:
'200':
description: greeting response
schema:
type: string
Expand Down
2 changes: 1 addition & 1 deletion examples/helloworld_async/spec/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ paths:
description: Generates a greeting message.
operationId: hello.post_greeting
responses:
200:
'200':
description: greeting response
content:
text/plain:
Expand Down
2 changes: 1 addition & 1 deletion examples/helloworld_async/spec/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ paths:
description: Generates a greeting message.
operationId: hello.post_greeting
responses:
200:
'200':
description: greeting response
schema:
type: string
Expand Down
2 changes: 1 addition & 1 deletion examples/oauth2/spec/mock_tokeninfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ paths:
summary: OAuth2 token info
operationId: mock_tokeninfo.get_tokeninfo
responses:
200:
'200':
description: Token info object
schema:
type: object
Expand Down
2 changes: 1 addition & 1 deletion examples/oauth2/spec/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ paths:
summary: Return secret string
operationId: app.get_secret
responses:
200:
'200':
description: secret response
content:
'text/plain':
Expand Down
2 changes: 1 addition & 1 deletion examples/oauth2/spec/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ paths:
summary: Return secret string
operationId: app.get_secret
responses:
200:
'200':
description: secret response
schema:
type: string
Expand Down
2 changes: 1 addition & 1 deletion examples/oauth2_local_tokeninfo/spec/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ paths:
summary: Return secret string
operationId: app.get_secret
responses:
200:
'200':
description: secret response
content:
text/plain:
Expand Down
2 changes: 1 addition & 1 deletion examples/oauth2_local_tokeninfo/spec/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ paths:
summary: Return secret string
operationId: app.get_secret
responses:
200:
'200':
description: secret response
schema:
type: string
Expand Down
14 changes: 7 additions & 7 deletions examples/sqlalchemy/spec/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ paths:
minimum: 0
default: 100
responses:
200:
'200':
description: Return pets
schema:
type: array
Expand All @@ -38,11 +38,11 @@ paths:
parameters:
- $ref: '#/parameters/pet_id'
responses:
200:
'200':
description: Return pet
schema:
$ref: '#/definitions/Pet'
404:
'404':
description: Pet does not exist
put:
tags: [Pets]
Expand All @@ -55,9 +55,9 @@ paths:
schema:
$ref: '#/definitions/Pet'
responses:
200:
'200':
description: Pet updated
201:
'201':
description: New pet created
delete:
tags: [Pets]
Expand All @@ -66,9 +66,9 @@ paths:
parameters:
- $ref: '#/parameters/pet_id'
responses:
204:
'204':
description: Pet was deleted
404:
'404':
description: Pet does not exist


Expand Down
6 changes: 3 additions & 3 deletions tests/fixtures/bad_operations/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ paths:
get:
operationId: no.module.or.function
responses:
200:
'200':
description: greeting response
schema:
type: object
put:
# operationId: XXX completely missing
responses:
200:
'200':
description: greeting response
schema:
type: object
post:
operationId: fakeapi.module_with_error.something
responses:
200:
'200':
description: greeting response
schema:
type: object
2 changes: 1 addition & 1 deletion tests/fixtures/bad_specs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ paths:
type: integer
default: somestring
responses:
200:
'200':
description: search
schema:
type: object
6 changes: 3 additions & 3 deletions tests/fixtures/datetime_support/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ paths:
summary: Generate data with date time
operationId: fakeapi.hello.get_datetime
responses:
200:
'200':
description: date time example
content:
application/json:
Expand All @@ -29,7 +29,7 @@ paths:
summary: Generate data with date
operationId: fakeapi.hello.get_date
responses:
200:
'200':
description: date example
content:
application/json:
Expand All @@ -46,7 +46,7 @@ paths:
summary: Generate data with uuid
operationId: fakeapi.hello.get_uuid
responses:
200:
'200':
description: uuid example
content:
application/json:
Expand Down
6 changes: 3 additions & 3 deletions tests/fixtures/datetime_support/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ paths:
get:
operationId: fakeapi.hello.get_datetime
responses:
200:
'200':
description: date time example
schema:
type: object
Expand All @@ -25,7 +25,7 @@ paths:
get:
operationId: fakeapi.hello.get_date
responses:
200:
'200':
description: date example
schema:
type: object
Expand All @@ -40,7 +40,7 @@ paths:
summary: Generate data with uuid
operationId: fakeapi.hello.get_uuid
responses:
200:
'200':
description: uuid example
schema:
type: object
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/default_param_error/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ paths:
summary: Default value does not match the param type
operationId: fakeapi.hello.test_default_mismatch_definition
responses:
200:
'200':
description: OK
parameters:
- name: age
Expand Down
Loading

0 comments on commit a48949c

Please sign in to comment.