json-schema: Changing the resolution base via 'id' does not work properly

Per issue #446. See below test case:

$data = json_decode(<<<'eot'
{
    "propertyOne": "blue"
}
eot
);

$base = json_decode(<<<'eot'
{
    "id": "schema.json",
    "properties": {
        "propertyOne": {
            "$ref": "propertyOne.json"
        }
    }
}
eot
);

$validator = new \JsonSchema\Validator();
var_dump($validator->validate($data, $base));

@bighappyface Could you please mark this as blocking for 6.0.0? I need to stare at the code some more, but at first look this may require significant refactoring of the $ref code.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 15

Commits related to this issue

Most upvoted comments

@mdeboer See #448. Assuming code review is OK, I will backport this fix to 5.x.x after merge.