From 3fad9f19680234b0a6a5d4d05635ee87f466e80a Mon Sep 17 00:00:00 2001 From: Profitroll <47523801+profitrollgame@users.noreply.github.com> Date: Tue, 20 Dec 2022 01:30:02 +0100 Subject: [PATCH] Removed scheme notice --- requests/albums.py | 10 +++++----- requests/photos.py | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/requests/albums.py b/requests/albums.py index a427cef..edb00eb 100644 --- a/requests/albums.py +++ b/requests/albums.py @@ -13,7 +13,7 @@ from fastapi.responses import UJSONResponse, Response from fastapi.openapi.models import APIKey from starlette.status import HTTP_204_NO_CONTENT, HTTP_401_UNAUTHORIZED, HTTP_404_NOT_FOUND, HTTP_406_NOT_ACCEPTABLE, HTTP_409_CONFLICT -@app.post("/albums", response_class=UJSONResponse, include_in_schema=True) +@app.post("/albums", response_class=UJSONResponse) async def album_create(name: str, title: str, apikey: APIKey = Depends(get_api_key)): if (check_project_key("photos", apikey)): @@ -45,7 +45,7 @@ async def album_create(name: str, title: str, apikey: APIKey = Depends(get_api_k else: raise HTTPException(status_code=HTTP_401_UNAUTHORIZED, detail=configGet("key_invalid", "messages")) -@app.get("/albums", response_class=UJSONResponse, include_in_schema=True) +@app.get("/albums", response_class=UJSONResponse) async def album_find(q: str, apikey: APIKey = Depends(get_api_key)): if (check_project_key("photos", apikey)): @@ -61,7 +61,7 @@ async def album_find(q: str, apikey: APIKey = Depends(get_api_key)): else: raise HTTPException(status_code=HTTP_401_UNAUTHORIZED, detail=configGet("key_invalid", "messages")) -@app.patch("/albums/{id}", response_class=UJSONResponse, include_in_schema=True) +@app.patch("/albums/{id}", response_class=UJSONResponse) async def album_patch(id: str, name: Union[str, None] = None, title: Union[str, None] = None, apikey: APIKey = Depends(get_api_key)): if (check_project_key("photos", apikey)): @@ -101,7 +101,7 @@ async def album_patch(id: str, name: Union[str, None] = None, title: Union[str, else: raise HTTPException(status_code=HTTP_401_UNAUTHORIZED, detail=configGet("key_invalid", "messages")) -@app.put("/albums/{id}", response_class=UJSONResponse, include_in_schema=True) +@app.put("/albums/{id}", response_class=UJSONResponse) async def album_put(id: str, name: str, title: str, apikey: APIKey = Depends(get_api_key)): if (check_project_key("photos", apikey)): @@ -137,7 +137,7 @@ async def album_put(id: str, name: str, title: str, apikey: APIKey = Depends(get else: raise HTTPException(status_code=HTTP_401_UNAUTHORIZED, detail=configGet("key_invalid", "messages")) -@app.delete("/album/{id}", response_class=UJSONResponse, include_in_schema=True) +@app.delete("/album/{id}", response_class=UJSONResponse) async def album_delete(id: str, apikey: APIKey = Depends(get_api_key)): if (check_project_key("photos", apikey)): diff --git a/requests/photos.py b/requests/photos.py index e748808..cdb6126 100644 --- a/requests/photos.py +++ b/requests/photos.py @@ -15,7 +15,7 @@ from fastapi.responses import UJSONResponse, Response from fastapi.openapi.models import APIKey from starlette.status import HTTP_204_NO_CONTENT, HTTP_400_BAD_REQUEST, HTTP_401_UNAUTHORIZED, HTTP_404_NOT_FOUND, HTTP_406_NOT_ACCEPTABLE, HTTP_409_CONFLICT -@app.post("/albums/{album}/photos", response_class=UJSONResponse, include_in_schema=True) +@app.post("/albums/{album}/photos", response_class=UJSONResponse) async def photo_upload(file: UploadFile, album: str, ignore_duplicates: bool = False, apikey: APIKey = Depends(get_api_key)): if (check_project_key("photos", apikey)): @@ -64,7 +64,7 @@ async def photo_upload(file: UploadFile, album: str, ignore_duplicates: bool = F else: raise HTTPException(status_code=HTTP_401_UNAUTHORIZED, detail=configGet("key_invalid", "messages")) -@app.get("/photos/{id}", include_in_schema=True) +@app.get("/photos/{id}") async def photo_get(id: str, apikey: APIKey = Depends(get_api_key)): if (check_project_key("photos", apikey)): @@ -87,7 +87,7 @@ async def photo_get(id: str, apikey: APIKey = Depends(get_api_key)): else: raise HTTPException(status_code=HTTP_401_UNAUTHORIZED, detail=configGet("key_invalid", "messages")) -@app.delete("/photos/{id}", include_in_schema=True) +@app.delete("/photos/{id}") async def photo_delete(id: str, apikey: APIKey = Depends(get_api_key)): if (check_project_key("photos", apikey)): @@ -106,7 +106,7 @@ async def photo_delete(id: str, apikey: APIKey = Depends(get_api_key)): else: raise HTTPException(status_code=HTTP_401_UNAUTHORIZED, detail=configGet("key_invalid", "messages")) -@app.get("/albums/{album}/photos", response_class=UJSONResponse, include_in_schema=True) +@app.get("/albums/{album}/photos", response_class=UJSONResponse) async def photo_find(q: str, album: str, page: int = 1, page_size: int = 100, apikey: APIKey = Depends(get_api_key)): if (check_project_key("photos", apikey)): @@ -134,7 +134,7 @@ async def photo_find(q: str, album: str, page: int = 1, page_size: int = 100, ap else: raise HTTPException(status_code=HTTP_401_UNAUTHORIZED, detail=configGet("key_invalid", "messages")) -@app.get("/photos/token/{token}", response_class=UJSONResponse, include_in_schema=True) +@app.get("/photos/token/{token}", response_class=UJSONResponse) async def photo_find_token(token: str): found_record = col_tokens.find_one( {"token": token} )