Open massadm opened 1 year ago
In details.
JsonPointer::getByPointer(<JSON Schema from example above>, '/properties/items/items/1/allOf/0')
result 'Key not found: 1'
.
Stack trace:
#0 ./vendor/swaggest/json-diff/src/JsonPointer.php(243): Swaggest\JsonDiff\JsonPointer::get(Object(Swaggest\JsonSchema\Schema), Array)
#1 ./SchemaService.php(37): **Swaggest\JsonDiff\JsonPointer::getByPointer**(Object(Swaggest\JsonSchema\Schema), '/properties/ite...')
#2 ./DebugValidate.php(97): SchemaService->validate(Object(stdClass), Object(stdClass))
...
While JsonPointer::getByPointer(<JSON Schema from example above>, preg_replace('/\/items\/items\/\d+\//', '/items/items/', '/properties/items/items/1/allOf/0'))
works.
Hello @vearutop and all contributors! I have a question.
https://github.com/swaggest/json-diff/releases/tag/v3.10.4 https://github.com/swaggest/php-json-schema/releases/tag/v0.12.41 PHP 5.6.33
JSON Schema:
Data:
Expected error:
But what does
:1
mean inprocessingPath
and why exception'Swaggest\JsonDiff\JsonPointerException'
with message'Key not found: 1'
in./vendor/swaggest/json-diff/src/JsonPointer.php:226
happening on trying JsonPointer::getByPointer() with JSON Schema above and Error->getSchemaPointer() as a pointer?