From 0553c860a065cf3ad7047c641ba23cd44a1a56ab Mon Sep 17 00:00:00 2001 From: Robert Meissner <50482279+RMeissnerCC@users.noreply.github.com> Date: Wed, 22 Jun 2022 16:00:22 +0200 Subject: [PATCH] 50 bug wrong response type for glom (#52) * #50 bug wrong response type for glom WIP: Reproducing bug * #50 bug wrong response type for glom WIP: Reproducing bug * #50 bug wrong response type for glom Refactoring glom usage * #50 bug wrong response type for glom Refactoring glom usage * #50 bug wrong response type for glom Refactoring naming Added description * #50 bug wrong response type for glom Refactoring naming Forcing glom to return empty strings instead of none for missing description * #50 bug wrong response type for glom Refactoring enum unions * #50 bug wrong response type for glom Refactoring CollectionAttributes * #50 bug wrong response type for glom Refactoring CollectionAttributes * #50 bug wrong response type for glom Refactoring and cleanup, removing outdated logic and code Adding documentation * #50 bug wrong response type for glom Cleanup * #50 bug wrong response type for glom Refactoring attribute names * #50 bug wrong response type for glom Refactoring attribute names --- src/app/api/api.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/api/api.py b/src/app/api/api.py index 8d779f3..489b884 100644 --- a/src/app/api/api.py +++ b/src/app/api/api.py @@ -86,6 +86,7 @@ def node_ids_for_major_collections( description=QUALITY_MATRIX_DESCRIPTION, ) async def get_quality( + *, database: Database = Depends(get_database), node_id: str = Query( default=COLLECTION_ROOT_ID, @@ -124,7 +125,7 @@ async def get_quality( description="""An unix timestamp in integer seconds since epoch yields the quality matrix at the respective date.""", ) async def get_past_quality_matrix( - timestamp: int, database: Database = Depends(get_database) + *, timestamp: int, database: Database = Depends(get_database) ): if not timestamp: raise HTTPException(status_code=400, detail="Invalid or no timestamp given") @@ -155,6 +156,7 @@ async def get_past_quality_matrix( form: The desired form of quality. This is used to query only the relevant type of data.""", ) async def get_timestamps( + *, database: Database = Depends(get_database), form: Forms = Query( default=Forms.REPLICATION_SOURCE, @@ -268,7 +270,7 @@ async def get_collection_counts( ) async def filter_collections_with_missing_attributes( *, - noderef_id: UUID = Depends(node_ids_for_major_collections), + node_id: UUID = Depends(node_ids_for_major_collections), missing_attribute: str = Path( ..., examples={ @@ -276,4 +278,4 @@ async def filter_collections_with_missing_attributes( }, ), ): - return await collections_with_missing_attributes(noderef_id, missing_attribute) + return await collections_with_missing_attributes(node_id, missing_attribute)