Skip to content
Snippets Groups Projects
Commit 7a1a9246 authored by Jedrzej Rybicki's avatar Jedrzej Rybicki
Browse files

no tuples in response_model. they are not supported by api

parent 788b7a13
No related branches found
No related tags found
No related merge requests found
...@@ -73,7 +73,7 @@ async def get_types(): ...@@ -73,7 +73,7 @@ async def get_types():
""" """
return [{element.value: "/" + element.value} for element in LocationDataType] return [{element.value: "/" + element.value} for element in LocationDataType]
@app.get("/{location_data_type}", response_model=List[Tuple[str, str]]) @app.get("/{location_data_type}")
async def list_datasets(location_data_type: LocationDataType): async def list_datasets(location_data_type: LocationDataType):
"""list id and name of every registered dataset for the specified type""" """list id and name of every registered dataset for the specified type"""
return adapter.get_list(location_data_type) return adapter.get_list(location_data_type)
...@@ -84,7 +84,7 @@ async def get_specific_dataset(location_data_type: LocationDataType, dataset_id: ...@@ -84,7 +84,7 @@ async def get_specific_dataset(location_data_type: LocationDataType, dataset_id:
"""returns all information about a specific dataset, identified by id""" """returns all information about a specific dataset, identified by id"""
return adapter.get_details(location_data_type, dataset_id) return adapter.get_details(location_data_type, dataset_id)
@app.post("/{location_data_type}", response_model=Tuple[str, LocationData]) @app.post("/{location_data_type}")
async def add_dataset(location_data_type: LocationDataType, async def add_dataset(location_data_type: LocationDataType,
dataset: LocationData, dataset: LocationData,
user: User = Depends(my_user)): user: User = Depends(my_user)):
...@@ -92,7 +92,7 @@ async def add_dataset(location_data_type: LocationDataType, ...@@ -92,7 +92,7 @@ async def add_dataset(location_data_type: LocationDataType,
return adapter.add_new(location_data_type, dataset, user.username) return adapter.add_new(location_data_type, dataset, user.username)
@app.put("/{location_data_type}/{dataset_id}", response_model=Tuple[str, LocationData]) @app.put("/{location_data_type}/{dataset_id}")
async def update_specific_dataset(location_data_type: LocationDataType, async def update_specific_dataset(location_data_type: LocationDataType,
dataset_id: str, dataset: LocationData, dataset_id: str, dataset: LocationData,
user: User = Depends(my_user)): user: User = Depends(my_user)):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment