Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to dereference schema from a different domain #83

Closed
Napas opened this issue May 17, 2018 · 2 comments
Closed

Ability to dereference schema from a different domain #83

Napas opened this issue May 17, 2018 · 2 comments

Comments

@Napas
Copy link

Napas commented May 17, 2018

Hi,

Is there ability to dereference a schema from a different domain. I.e

   {
        "$id": "https://example.com/schema.json",
        "type": "array",
        "other": {
            "type": "array",
            "items": {
                "anyOf": [
                  { "$ref": "other/schema.json" }
                ]
            }
        }
    }

$ref should resolve to the http:https://example.com/other/schema.json independently on current URL it is running.

Is there a way to set a base URL where it should look for the schemas?

@JamesMessinger
Copy link
Member

JamesMessinger commented May 23, 2018

JSON Schema $Ref Parser is an implementation of the JSON Reference specification and the JSON Pointer specification, not the JSON Schema specification. Thus, the $id keyword isn't supported, because that's not part of JSON Reference or JSON Pointer.

I might be willing to add support for the $id keyword at some point in the future, if there's enough demand for it. But I want to hold-off on that for now, because it could be very confusing to start supporting part of the JSON Schema specification but not all of it.

See this issue for more details.

@JamesMessinger
Copy link
Member

I'm closing this issue and marking it as a duplicate of #22 so we can keep any relevant discussion/updates in one place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants