From d2ac7bf84a3a6e0923812588d59bf139014742d1 Mon Sep 17 00:00:00 2001 From: Petitminion Date: Mon, 18 Nov 2024 18:05:52 +0100 Subject: [PATCH] Display v2 endpoints to swagger (#2352) --- api/config/schema.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/config/schema.py b/api/config/schema.py index 99e4555fa..fbe500dca 100644 --- a/api/config/schema.py +++ b/api/config/schema.py @@ -45,6 +45,7 @@ def custom_preprocessing_hook(endpoints): # your modifications to the list of operations that are exposed in the schema api_type = os.environ.get("API_TYPE", "v1") + api_type_v2 = os.environ.get("API_TYPE", "v2") for path, path_regex, method, callback in endpoints: if path.startswith("/api/v1/providers"): @@ -56,7 +57,9 @@ def custom_preprocessing_hook(endpoints): if path.startswith("/api/v1/oauth/authorize"): continue - if path.startswith(f"/api/{api_type}"): + if path.startswith(f"/api/{api_type}") or path.startswith( + f"/api/{api_type_v2}" + ): filtered.append((path, path_regex, method, callback)) return filtered