Skip to content

Commit 842c562

Browse files
committed
Swap values in tests (in violation of spec)
This commit deliberately tests in a way that violates the spec. Versions of this library prior to 6.0.0 allow properties adjacent to $ref to override properties with the same name from the $ref'ed schema. This is explicitly in violation of the spec, but cannot be changed in 5.x.x, as it results in a significant behavioral change that may break end users' application logic. This issue is resolved in 6.0.0, and siblings of $ref are correctly ignored from 6.0.0 onwards.
1 parent 5550f3c commit 842c562

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/Constraints/DefaultPropertiesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,12 @@ public function getValidTests()
121121
),
122122
array(// #15 infinite recursion via $ref (object)
123123
'{}',
124-
'{"properties":{"propertyOne": {"$ref": "#","default": "valueOne"}}, "default": {}}',
124+
'{"properties":{"propertyOne": {"$ref": "#","default": {}}}, "default": "valueOne"}',
125125
'{"propertyOne":{}}'
126126
),
127127
array(// #16 infinite recursion via $ref (array)
128128
'[]',
129-
'{"items":[{"$ref":"#","default":"valueOne"}], "default": []}',
129+
'{"items":[{"$ref":"#","default":[]}], "default": "valueOne"}',
130130
'[[]]'
131131
),
132132
array(// #17 default top value does not overwrite defined null

0 commit comments

Comments
 (0)