Skip to content

Commit bc56016

Browse files
committed
Assert merging types works
1 parent f165e86 commit bc56016

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/hypothesis_jsonschema/_canonicalise.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,10 +522,12 @@ def canonicalish(schema: JSONType) -> Dict[str, Any]:
522522
else:
523523
break
524524
else:
525-
# All subschemas have only the "type" keyword, then we merge all types into the parent schema
525+
# All subschemas have only the "type" keyword, then we merge all types
526+
# into the parent schema
526527
del schema["anyOf"]
527528
new_types = canonicalish({"type": types})
528529
schema = merged([schema, new_types])
530+
assert isinstance(schema, dict) # merging was certainly valid
529531
if "allOf" in schema:
530532
schema["allOf"] = [
531533
json.loads(enc)

0 commit comments

Comments
 (0)