Skip to content

Mime type for schema issues #540

Closed
Closed
@dylanneild

Description

@dylanneild

Having a minor issue with validation against a Schema that's being served off of GitHub (using the raw URL retrieve):

Stack trace:
#0 /Users/dylan/GitHub/swimguide-web/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriRetriever.php(190): JsonSchema\Uri\UriRetriever->confirmMediaType(Object(JsonSchema\Uri\Retrievers\FileGetContents), 'https://raw.git...')
#1 /Users/dylan/GitHub/swimguide-web/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriRetriever.php(162): JsonSchema\Uri\UriRetriever->loadSchema('https://raw.git...')
#2 /Users/dylan/GitHub/swimguide-web/vendor/justinrainbow/json-schema/src/JsonSchema/SchemaStorage.php(52): JsonSchema\Uri\UriRetriever->retrieve('https://raw.git...')
#3 /Users/dylan/GitHub/swimguide-web/vendor/justinrainbow/json-schema/src/JsonSchema/SchemaStorage.php(115): JsonSchema\SchemaStorage->addSchema('https://raw.git...')
#4 /Users/dylan/GitHub/swimguide-web/vendor/justinrainb in /Users/dylan/GitHub/swimguide-web/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriRetriever.php on line 73

Basically, it looks like UriRetriever.php is demanding that the mime type of the schema document is application/schema+json. GitHub spits out text/plain.

Any flag or option possible to make UrlValidator ignore this and simply validate the schema syntactically?

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