@@ -542,12 +542,12 @@ def test_validators_use_proper_draft():
542
542
(ROOT_REFERENCE , ROOT_REFERENCE ),
543
543
(NESTED , NESTED ),
544
544
(NESTED_WITH_ID , NESTED_WITH_ID ),
545
- # "foo" content should be inlined as is , because "#" is recursive (special case)
545
+ # "foo" content should not be inlined, because "#" is recursive (special case)
546
546
(
547
547
{"foo" : {"$ref" : "#" }, "not" : {"$ref" : "#foo" }},
548
- {"foo" : {"$ref" : "#" }, "not" : {"$ref" : "#" }},
548
+ {"foo" : {"$ref" : "#" }, "not" : {"$ref" : "#foo " }},
549
549
),
550
- # "foo" content should be inlined as is , because it points to itself
550
+ # "foo" content should not be inlined, because it points to itself
551
551
(
552
552
SELF_REFERENTIAL ,
553
553
SELF_REFERENTIAL ,
@@ -558,15 +558,14 @@ def test_validators_use_proper_draft():
558
558
# 1. We start from resolving "$ref" in "not"
559
559
# 2. at this point we don't know this path is recursive, so we follow to "foo"
560
560
# 3. inside "foo" we found a reference to "foo", which means it is recursive
561
- {"foo" : {"not" : {"$ref" : "#foo" }}, "not" : {"not" : { " $ref" : "#foo" } }},
561
+ {"foo" : {"not" : {"$ref" : "#foo" }}, "not" : {"$ref" : "#foo" }},
562
562
),
563
563
# Circular reference between two schemas
564
564
(
565
565
{"foo" : {"$ref" : "#bar" }, "bar" : {"$ref" : "#foo" }, "not" : {"$ref" : "#foo" }},
566
566
# 1. We start in "not" and follow to "foo"
567
567
# 2. In "foo" we follow to "bar"
568
568
# 3. Here we see a reference to previously seen scope, which means it is a recursive path
569
- # We take the schema where we stop and inline it to the starting point (therefore it is `{"$ref": "#foo"}`)
570
569
{"foo" : {"$ref" : "#bar" }, "bar" : {"$ref" : "#foo" }, "not" : {"$ref" : "#foo" }},
571
570
),
572
571
),
@@ -637,14 +636,7 @@ def test_skip_recursive_references_simple_schemas(schema, expected):
637
636
"properties" : {"foo" : {"$ref" : "#/definitions/foo" }},
638
637
},
639
638
{
640
- "properties" : {
641
- "foo" : {
642
- "properties" : {
643
- "bar" : {"$ref" : "#/definitions/foo" },
644
- "baz" : {"$ref" : "#/definitions/foo" },
645
- }
646
- }
647
- },
639
+ "properties" : {"foo" : {"$ref" : "#/definitions/foo" }},
648
640
},
649
641
),
650
642
),
0 commit comments