fix: return copy of schema without 'definitions' key
Instead of delete key 'definitions' from schema, bc schema was "cached" and if you try to load swagger twice, you got "no definitions" exception
This commit is contained in:
parent
67a95ec9c9
commit
5567d73952
@ -55,9 +55,8 @@ class _OASResponseBuilder:
|
|||||||
if 'definitions' in schema:
|
if 'definitions' in schema:
|
||||||
for k, v in schema['definitions'].items():
|
for k, v in schema['definitions'].items():
|
||||||
self._definitions[k] = v
|
self._definitions[k] = v
|
||||||
del schema['definitions']
|
|
||||||
|
|
||||||
return schema
|
return {i:schema[i] for i in schema if i!='definitions'}
|
||||||
|
|
||||||
def _handle_pydantic_base_model(self, obj):
|
def _handle_pydantic_base_model(self, obj):
|
||||||
if is_pydantic_base_model(obj):
|
if is_pydantic_base_model(obj):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user