From 5db0af558f6bc3fde5a21be1cf868a6bc431f2b0 Mon Sep 17 00:00:00 2001 From: Ali Asadi Date: Mon, 3 Aug 2026 17:12:43 +0330 Subject: [PATCH] Prefix proxy swagger paths with /api to match actual routes --- apps/proxy/schema.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/proxy/schema.py b/apps/proxy/schema.py index 96248ba..6ed3b7e 100644 --- a/apps/proxy/schema.py +++ b/apps/proxy/schema.py @@ -54,7 +54,7 @@ def merge_upstream_schemas(result, generator, request, public): """drf-spectacular POSTPROCESSING_HOOKS entry point. Folds every proxied service's own OpenAPI document into this service's - schema under `//...` paths (mirroring apps.proxy.views), so the + schema under `/api//...` paths (mirroring apps.proxy.views), so the combined swagger covers every endpoint this proxy forwards to, DTOs included. Schemas are cached per service; a service that's unconfigured or unreachable is skipped rather than failing the whole document. @@ -109,6 +109,6 @@ def merge_upstream_schemas(result, generator, request, public): operation["tags"] = [label] if "operationId" in operation: operation["operationId"] = f"{service}_{operation['operationId']}" - result["paths"][f"/{service}{path}"] = proxied_operations + result["paths"][f"/api/{service}{path}"] = proxied_operations return result