Skip to content

Commit

Permalink
Add test.
Browse files Browse the repository at this point in the history
  • Loading branch information
yyamano committed Aug 21, 2023
1 parent 97c796b commit 1b64de2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ def post_bar(request: Request) -> None:


@app.post('/convert', response_model=bytes)
def convert(format: Optional[str] = 'pdf', request: Request = ...) -> bytes:
def convert1(format: Optional[str] = 'pdf', request: Request = ...) -> bytes:
pass


@app.put('/convert', response_model=bytes)
def convert2(format: Optional[str] = None, request: Request = ...) -> bytes:
pass


Expand Down
25 changes: 24 additions & 1 deletion tests/data/openapi/default_template/body_and_parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ paths:
required: true
/convert:
post:
operationId: convert
description: https://github.com/koxudaxi/fastapi-code-generator/issues/376
operationId: convert1
parameters:
- in: query
name: format
Expand All @@ -360,6 +361,28 @@ paths:
schema:
type: string
format: binary
put:
description: https://github.com/koxudaxi/fastapi-code-generator/issues/322
operationId: convert2
parameters:
- in: query
name: format
schema:
type: string
requestBody:
required: true
content:
application/octet-stream:
schema:
type: string
format: binary
responses:
"200":
content:
application/octet-stream:
schema:
type: string
format: binary
components:
parameters:
MyParam:
Expand Down

0 comments on commit 1b64de2

Please sign in to comment.