1
0
mirror of https://github.com/justinrainbow/json-schema.git synced 2025-05-10 16:35:17 +02:00

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.
This commit is contained in:
Erayd 2018-02-14 14:53:01 +13:00
parent 5550f3c359
commit 842c562f13
No known key found for this signature in database
GPG Key ID: 3CA3675E3C90637F

@ -121,12 +121,12 @@ class DefaultPropertiesTest extends VeryBaseTestCase
),
array(// #15 infinite recursion via $ref (object)
'{}',
'{"properties":{"propertyOne": {"$ref": "#","default": "valueOne"}}, "default": {}}',
'{"properties":{"propertyOne": {"$ref": "#","default": {}}}, "default": "valueOne"}',
'{"propertyOne":{}}'
),
array(// #16 infinite recursion via $ref (array)
'[]',
'{"items":[{"$ref":"#","default":"valueOne"}], "default": []}',
'{"items":[{"$ref":"#","default":[]}], "default": "valueOne"}',
'[[]]'
),
array(// #17 default top value does not overwrite defined null