Skip to content

Commit 0f933d3

Browse files
committed
Regression test for #65
1 parent 927fbf8 commit 0f933d3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_canonicalise.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,3 +558,19 @@ def test_validators_use_proper_draft():
558558
}
559559
cc = canonicalish(schema)
560560
jsonschema.validators.validator_for(cc).check_schema(cc)
561+
562+
563+
def test_reference_resolver_issue_65_regression():
564+
schema = {
565+
"allOf": [{"$ref": "#/definitions/ref"}, {"required": ["foo"]}],
566+
"properties": {"foo": {}},
567+
"definitions": {"ref": {"maxProperties": 1}},
568+
"type": "object",
569+
}
570+
res = resolve_all_refs(schema)
571+
can = canonicalish(res)
572+
assert "$ref" not in res
573+
assert "$ref" not in can
574+
for s in (schema, res, can):
575+
with pytest.raises(jsonschema.ValidationError):
576+
jsonschema.validate({}, s)

0 commit comments

Comments
 (0)