diff --git a/connexion/middleware/swagger_ui.py b/connexion/middleware/swagger_ui.py index 3f701bcb0..3a31be5c2 100644 --- a/connexion/middleware/swagger_ui.py +++ b/connexion/middleware/swagger_ui.py @@ -63,7 +63,7 @@ def _base_path_for_prefix(self, request: StarletteRequest) -> str: "route_root_path", request.scope.get("root_path", "") ).rstrip("/") - def _spec_for_prefix(self, request): + def _spec_for_prefix(self, request) -> dict: """ returns a spec with a modified basePath / servers block which corresponds to the incoming request path. diff --git a/connexion/spec.py b/connexion/spec.py index 40fe46d70..83322b1c4 100644 --- a/connexion/spec.py +++ b/connexion/spec.py @@ -204,7 +204,7 @@ def enforce_string_keys(obj): return OpenAPISpecification(spec, base_uri=base_uri) def clone(self): - return type(self)(copy.deepcopy(self._raw_spec)) + return type(self)(copy.deepcopy(self._spec)) @classmethod def load(cls, spec, *, arguments=None):