Skip to content

Schema validation error on hyperschema link with $ref #173

@ricobl

Description

@ricobl

I've got the following error trying to validate a schema with a reference on a link:

ValidationError: u'#' is not of type u'object'

The base schema:

{
    "$ref": "http://json-schema.org/draft-03/hyper-schema#"
}

Here is a stripped version of the schema I'm trying to validate:

{
    "$schema": "http://json-schema.org/draft-03/hyper-schema#",
    "links": [
        {
            "href": "{id}",
            "method": "POST",
            "rel": "create",
            "schema": {
                "$ref": "#"
            }
        }
    ]
}

I've forked the project and added a test exploring this issue:
ricobl@565084f#diff-d41d8cd98f00b204e9800998ecf8427e

I didn't get any error using the online validators:
https://json-schema-validator.herokuapp.com/
http://jsonschemalint.com/

Looks like the validator isn't expanding the $ref, trying to validate the schema URI as an object.

Any clues?

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