From 00d3d627625b7c396e2150b039aba5ca8ab926a3 Mon Sep 17 00:00:00 2001 From: profitroll Date: Thu, 22 Jun 2023 14:43:00 +0200 Subject: [PATCH 1/2] Fixed openapi spec --- extensions/photos.py | 12 +++++++++++- extensions/videos.py | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/extensions/photos.py b/extensions/photos.py index 1ca11c0..a8bb6be 100644 --- a/extensions/photos.py +++ b/extensions/photos.py @@ -267,7 +267,17 @@ if configGet("media_token_access") is True: photo_get_responses = { - 200: {"content": {"image/*": {}}}, + 200: { + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary", + "contentMediaType": "image/*", + } + } + } + }, 404: PhotoNotFoundError("id").openapi, } diff --git a/extensions/videos.py b/extensions/videos.py index 12fd20b..2152d0a 100644 --- a/extensions/videos.py +++ b/extensions/videos.py @@ -93,7 +93,17 @@ async def video_upload( video_get_responses = { - 200: {"content": {"video/*": {}}}, + 200: { + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary", + "contentMediaType": "video/*", + } + } + } + }, 404: VideoNotFoundError("id").openapi, } -- 2.39.2 From 24f4773dd7ec194609b79a55f0e7be9517a1221a Mon Sep 17 00:00:00 2001 From: profitroll Date: Thu, 22 Jun 2023 14:43:15 +0200 Subject: [PATCH 2/2] Updated to v0.4 --- modules/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/app.py b/modules/app.py index 43f6bfb..79d9b8f 100644 --- a/modules/app.py +++ b/modules/app.py @@ -1,7 +1,7 @@ from fastapi import FastAPI from fastapi.openapi.docs import get_redoc_html, get_swagger_ui_html -app = FastAPI(title="END PLAY Photos", docs_url=None, redoc_url=None, version="0.3") +app = FastAPI(title="END PLAY Photos", docs_url=None, redoc_url=None, version="0.4") @app.get("/docs", include_in_schema=False) -- 2.39.2