Skip to content

Commit

Permalink
fix regression on param default value #24
Browse files Browse the repository at this point in the history
  • Loading branch information
juliecoust committed Sep 28, 2021
1 parent ed55e39 commit 63aff2c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@
"description":"Return projects that can be written to (including erased) by the current user",
"required":false,
"schema":{
"title":"Nor managing",
"title":"For managing",
"type":"boolean",
"description":"Return projects that can be written to (including erased) by the current user",
"default":false
Expand All @@ -847,7 +847,8 @@
"schema":{
"title":"Title filter",
"type":"string",
"description":"Use this pattern for matching returned projects names"
"description":"Use this pattern for matching returned projects names",
"default":""
},
"example":"Tara",
"name":"title_filter",
Expand Down Expand Up @@ -1080,7 +1081,8 @@
"schema":{
"title":"For managinig",
"type":"boolean",
"description":"For managing this project."
"description":"For managing this project.",
"default":false
},
"example":false,
"name":"for_managing",
Expand Down
6 changes: 3 additions & 3 deletions py/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,13 +450,13 @@ def search_projects(current_user: Optional[int] = Depends(get_optional_current_u
not_granted: bool = Query(default=False, title="Not granted",
description="Return projects on which the current user has _no permission_, but visible to him/her",
example=False),
for_managing: bool = Query(default=False, title="Nor managing",
for_managing: bool = Query(default=False, title="For managing",
description="Return projects that can be written to (including erased) by the current user",
example=False),
title_filter: str = Query(default="", title="Title filter",
description="Use this pattern for matching returned projects names",
example="Tara"),
instrument_filter: str = Query(default='', title="Instrument filter",
instrument_filter: str = Query(default="", title="Instrument filter",
description="Only return projects where this instrument was used",
example="uvp5"),
filter_subset: bool = Query(default=False, title="Filter subset",
Expand Down Expand Up @@ -531,7 +531,7 @@ def project_subset(project_id: int,
@app.get("/projects/{project_id}", tags=['projects'], response_model=ProjectModel)
def project_query(project_id: int,
for_managing: Optional[bool] = Query(title="For managinig", description="For managing this project.",
default=None, example=False),
default=False, example=False),
current_user: Optional[int] = Depends(get_optional_current_user)) -> ProjectBO:
"""
**Returns project** if it exists for current user, eventually for managing it.
Expand Down

0 comments on commit 63aff2c

Please sign in to comment.