Skip to content

Error during schema validation #376

Closed
erasys/openapi-php
#17
@sruedel-dotsource

Description

@sruedel-dotsource

I have the following schema:
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "oneOf": [ { "properties": { "localeId": { "type": "integer" }, "answer": { "type": "string" }, "inputs": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/inputs" } } }, "required": [ "localeId", "answer" ] }, { "properties": { "answerId": { "type": "integer" }, "inputs": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/inputs" } } }, "required": ["answerId"] } ], "definitions": { "inputs": { "properties": { "id": { "type": "integer" }, "value": { "type": "string" } }, "required": [ "id", "value" ] } } }

If I want to validate data, the JsonSchema\SchemaStorage::resolveRef were called with parameter "#/definitions/inputs". The problem is that JsonPointer returned an empty filename in JsonSchema\SchemaStorage::addSchema and the uriRetriever try to get contents from a empty file which runs into an error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions