From 3a368d263cb43fbcf1e9fe5d2b57ac635b264deb Mon Sep 17 00:00:00 2001 From: Alvaro Lopez Garcia Date: Fri, 9 Aug 2024 11:35:07 +0200 Subject: [PATCH 1/2] fix: do not pass basePath to aiohttp_apispec Passing the basePath to the aiohttp_apispec.setup_aiohttp_apispec method caused that URL that were used from the Swagger UI added the path twice, resulting in 404 not found methods. Fixes #111 --- deepaas/api/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/deepaas/api/__init__.py b/deepaas/api/__init__.py index ae9a3d71..de576b40 100644 --- a/deepaas/api/__init__.py +++ b/deepaas/api/__init__.py @@ -115,7 +115,6 @@ async def get_app( "description": "API documentation", "url": "https://deepaas.readthedocs.org/", }, - basePath=base_path, version=deepaas.extract_version(), url=swagger, swagger_path=doc if enable_doc else None, From 36574e0a9f8a72a5e766f02063de129f140897d8 Mon Sep 17 00:00:00 2001 From: Alvaro Lopez Garcia Date: Fri, 9 Aug 2024 11:56:59 +0200 Subject: [PATCH 2/2] fix: also serve static_path from base_path Fixes #111 --- deepaas/api/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/deepaas/api/__init__.py b/deepaas/api/__init__.py index de576b40..be07064f 100644 --- a/deepaas/api/__init__.py +++ b/deepaas/api/__init__.py @@ -103,6 +103,7 @@ async def get_app( if swagger: doc = str(pathlib.Path(base_path + doc)) swagger = str(pathlib.Path(base_path + "/swagger.json")) + static_path = str(pathlib.Path(base_path + static_path)) # init docs with all parameters, usual for ApiSpec aiohttp_apispec.setup_aiohttp_apispec(