Skip to content

processingPath/schemaPointer #150

@massadm

Description

@massadm

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:

{
    "$schema": "https://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "items": {
            "type": "array",
            "items": {
                "allOf": [
                    { "type": "number" },
                    { "type": "integer", "minimum": 1 },
                    { "type": "integer", "maximum": 2 }
                ]
            }
        }
    }
}

Data:

{
    "items": [
        1,
        "z"
    ]
}

Expected error:

Swaggest\JsonSchema\Exception\Error Object
(
    [error] => Number expected, "z" received
    [schemaPointers] => Array
        (
            [0] => /properties/items/items/1/allOf/0
        )

    [dataPointer] => /items/1
    [processingPath] => #->properties:items->items[1]:1->allOf[0]
    [subErrors] => 
)

But what does :1 mean in processingPath 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions