Skip to content

Commit

Permalink
docs: /v1/data/topics
Browse files Browse the repository at this point in the history
  • Loading branch information
sushichan044 committed Oct 25, 2024
1 parent 93e61bf commit 20f0874
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/birdxplorer_api/routers/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
)
from birdxplorer_common.storage import Storage

from .openapi_doc import V1DataNotesDocs, V1DataPostsDocs
from .openapi_doc import V1DataNotesDocs, V1DataPostsDocs, V1DataTopicsDocs


class TopicListResponse(BaseModel):
Expand Down Expand Up @@ -67,7 +67,7 @@ def get_user_enrollment_by_participant_id(
raise ValueError(f"participant_id={participant_id} not found")
return res

@router.get("/topics", response_model=TopicListResponse)
@router.get("/topics", description=V1DataTopicsDocs.description, response_model=TopicListResponse)
def get_topics() -> TopicListResponse:
return TopicListResponse(data=list(storage.get_topics()))

Expand Down
4 changes: 4 additions & 0 deletions api/birdxplorer_api/routers/openapi_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,7 @@ class FastAPIEndpointDocs(Generic[_KEY]):
},
)

V1DataTopicsDocs = FastAPIEndpointDocs(
"自動分類されたコミュニティノートのトピックを取得するエンドポイント",
{},
)

0 comments on commit 20f0874

Please sign in to comment.