Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yu23ki14 committed Nov 3, 2024
1 parent 792eae6 commit f01cd78
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions api/birdxplorer_api/openapi_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,22 @@ class FastAPIEndpointDocs(Generic[_KEY]):
},
}

v1_data_notes_search_text: FastAPIEndpointParamDocs = {
"description": """
指定した文字列を含む Note を検索して取得する。検索は Note の**Summaryに対して**行われる。
""",
"openapi_examples": {
"default": {
"summary": "指定しない (デフォルト)",
"value": None,
},
"python": {
"summary": "「Python」を含む Post を取得する",
"value": "Python",
},
},
}


# GET /api/v1/data/notes のクエリパラメータの OpenAPI ドキュメント
V1DataNotesDocs = FastAPIEndpointDocs(
Expand All @@ -452,6 +468,7 @@ class FastAPIEndpointDocs(Generic[_KEY]):
"post_ids": v1_data_notes_post_ids,
"current_status": v1_data_notes_current_status,
"language": v1_data_notes_language,
"search_text": v1_data_notes_search_text,
},
)

Expand Down
2 changes: 1 addition & 1 deletion api/birdxplorer_api/routers/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def get_notes(
post_ids: Union[List[PostId], None] = Query(default=None, **V1DataNotesDocs.params["post_ids"]),
current_status: Union[None, List[str]] = Query(default=None, **V1DataNotesDocs.params["current_status"]),
language: Union[LanguageIdentifier, None] = Query(default=None, **V1DataNotesDocs.params["language"]),
search_text: Union[None, str] = Query(default=None, **V1DataPostsDocs.params["search_text"]),
search_text: Union[None, str] = Query(default=None, **V1DataNotesDocs.params["search_text"]),
) -> NoteListResponse:
if created_at_from is not None and isinstance(created_at_from, str):
created_at_from = ensure_twitter_timestamp(created_at_from)
Expand Down

0 comments on commit f01cd78

Please sign in to comment.