Skip to content

Commit

Permalink
Swagger doc improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
keul committed Sep 5, 2024
1 parent cdc1d7a commit 5f23430
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion cads_catalogue_api_service/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ def get_portals(


def get_site(
site=fastapi.Header(default=None, alias=config.SITE_HEADER_NAME),
site=fastapi.Header(
default=None, alias=config.SITE_HEADER_NAME, include_in_schema=False
),
) -> list[str] | None:
"""Fastapi dependency that provides the CADS portal profile."""
return site
6 changes: 3 additions & 3 deletions cads_catalogue_api_service/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def query_messages(


@router.get("/collections/{collection_id}/messages", response_model=models.Messages)
def list_messages_by_id(
def list_messages_by_dataset(
collection_id: str,
session=fastapi.Depends(dependencies.get_session),
) -> models.Messages:
Expand Down Expand Up @@ -105,7 +105,7 @@ def list_changelog_by_id(
collection_id: str,
session=fastapi.Depends(dependencies.get_session),
) -> models.Changelog:
"""Endpoint to get all changelog of a specific collection."""
"""Endpoint to get historical messages of a dataset."""
results = query_messages(
session=session, live=False, is_global=False, collection_id=collection_id
)
Expand Down Expand Up @@ -153,7 +153,7 @@ def list_changelog(
session=fastapi.Depends(dependencies.get_session),
site: str | None = fastapi.Depends(dependencies.get_site),
) -> models.Changelog:
"""Endpoint to get all changelog."""
"""Full changelog of site messages."""
results = query_messages(session=session, live=False, is_global=True, site=site)
return models.Changelog(
changelog=[
Expand Down
4 changes: 2 additions & 2 deletions cads_catalogue_api_service/vocabularies.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ async def list_licences(


@router.get("/licences/{licence_uid}", response_model=models.Licence)
async def list_licence(
async def licence_details(
session=fastapi.Depends(dependencies.get_session),
licence_uid: str = fastapi.Path(..., title="Licence UID"),
) -> models.Licence:
"""Endpoint to get all registered licences."""
"""Licence details."""
licence: cads_catalogue.database.Licence = query_licence(session, licence_uid)
return models.Licence(
id=licence.licence_uid,
Expand Down

0 comments on commit 5f23430

Please sign in to comment.