Skip to content

Commit 6012846

Browse files
committed
Recursively expand all $ref strings in schemas
1 parent 84cf29b commit 6012846

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

fastjsonschema/generator.py

+1-9
Original file line numberDiff line numberDiff line change
@@ -254,17 +254,9 @@ def _expand_refs(self, definition):
254254
return [self._expand_refs(v) for v in definition]
255255
if not isinstance(definition, dict):
256256
return definition
257-
if "$ref" in definition:
257+
if "$ref" in definition and isinstance(definition["$ref"], str):
258258
with self._resolver.resolving(definition["$ref"]) as schema:
259259
return schema
260-
if "properties" in definition:
261-
return {
262-
**definition,
263-
"properties": {
264-
k: self._expand_refs(v)
265-
for k, v in definition["properties"].items()
266-
}
267-
}
268260
return {k: self._expand_refs(v) for k, v in definition.items()}
269261

270262
def create_variable_with_length(self):

0 commit comments

Comments
 (0)