Skip to content

Commit bb48fb3

Browse files
Fix swagger UI for split specs (#2002)
Fixes #1909 This PR uses the already resolved spec when swagger UI requests it.
1 parent cef665c commit bb48fb3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

connexion/middleware/swagger_ui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def _base_path_for_prefix(self, request: StarletteRequest) -> str:
6363
"route_root_path", request.scope.get("root_path", "")
6464
).rstrip("/")
6565

66-
def _spec_for_prefix(self, request):
66+
def _spec_for_prefix(self, request) -> dict:
6767
"""
6868
returns a spec with a modified basePath / servers block
6969
which corresponds to the incoming request path.

connexion/spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def enforce_string_keys(obj):
204204
return OpenAPISpecification(spec, base_uri=base_uri)
205205

206206
def clone(self):
207-
return type(self)(copy.deepcopy(self._raw_spec))
207+
return type(self)(copy.deepcopy(self._spec))
208208

209209
@classmethod
210210
def load(cls, spec, *, arguments=None):

0 commit comments

Comments
 (0)