Skip to content

Commit

Permalink
replicate swagger-ui problem and hacky solution
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkent committed Feb 21, 2024
1 parent 994f53f commit 5cc388c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
5 changes: 4 additions & 1 deletion connexion/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,10 @@ def enforce_string_keys(obj):
return OpenAPISpecification(spec, base_uri=base_uri)

def clone(self):
return type(self)(copy.deepcopy(self._raw_spec))
try:
return type(self)(copy.deepcopy(self._raw_spec))
except jsonschema.exceptions.RefResolutionError:
return type(self)(copy.deepcopy(self._spec))

@classmethod
def load(cls, spec, *, arguments=None):
Expand Down
7 changes: 7 additions & 0 deletions tests/fixtures/simple/foo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title: foo
type: object
properties:
foo:
type: string
foo4:
type: string
7 changes: 1 addition & 6 deletions tests/fixtures/simple/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,7 @@ paths:
content:
application/json:
schema:
type: object
properties:
foo:
type: string
foo4:
type: string
$ref: ./foo.yaml
/exploded-deep-object-param-additional-properties:
get:
summary: Returns dict response with flexible properties
Expand Down

0 comments on commit 5cc388c

Please sign in to comment.