Skip to content

Commit 983c0bc

Browse files
authored
Merge pull request #18 from koxudaxi/fix_default_value_of_query_paramter
fix default value of query paramter
2 parents cca229b + d7e4a7c commit 983c0bc

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

poetry.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fastapi-codegen = "fastapi_code_generator.__main__:app"
2828
[tool.poetry.dependencies]
2929
python = "^3.8.0"
3030
typer = {extras = ["all"], version = "^0.2.1"}
31-
datamodel-code-generator = "^0.5.8"
31+
datamodel-code-generator = "^0.5.9"
3232
stringcase = "^1.2.0"
3333
black = "19.10b0"
3434
isort = "^4.3.21"

tests/data/expected/openapi/body_and_parameters/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
@app.get('/pets', response_model=List[Pet])
17-
def list_pets(limit: Optional[int] = None) -> List[Pet]:
17+
def list_pets(limit: Optional[int] = 0) -> List[Pet]:
1818
pass
1919

2020

tests/data/openapi/body_and_parameters.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ paths:
1919
description: How many items to return at one time (max 100)
2020
required: false
2121
schema:
22+
default: 0
2223
type: integer
2324
format: int32
2425
responses:

0 commit comments

Comments
 (0)