Skip to content

Make $schema lookup more liberal for empty fragment URLs #569

@jswinarton

Description

@jswinarton

I have a valid schema document that contains the following $schema value:

{
  "$schema": "http://json-schema.org/draft-07/schema/#"
}

When validating an instance against this schema, I get the following warning:

/usr/local/lib/python3.7/site-packages/jsonschema/validators.py:893: DeprecationWarning: The metaschema specified by $schema was not found. Using the latest draft to validate, but this will raise an error in the future.

I discovered that I can suppress the error by changing removing the trailing slash and hash from the schema URI, e.g. http://json-schema.org/draft-07/schema.

I think the validator should allow for some variations on URI formats--the JSON Schema documentation specifies the $schema value with the trailing slash and hash, so I believe that will be the most common format users attempt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething doesn't work the way it should.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions