Skip to content

Relative references resolved against the script root instead of schema's "id" #544

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

Open
kachnitel opened this issue Dec 30, 2015 · 1 comment

Comments

@kachnitel
Copy link

Hello!

I'm trying to achieve resolving of references outside of current schema file using "id" property as described in schema v4, however, the editor keeps trying to fetch the referred file from an URL relative to the editor's URL.

{
  "$schema": "http://json-schema.org/draft-04/schema",
  "id": "http://localhost/json-editor/schema/function.json",
  "title": "Function",
  "oneOf": [
    {
      "$ref": "./fn_md5.json"
    },
    {
      "$ref": "fn_sha1.json"
    }
  ]
}

In this schema, both of the references should be fetched from http://localhost/json-editor/schema/fn_md5.json (or ..._sha1.json respectively, of course), however, the url is resolved wrong and the editor tries to download it from wherever the editor demo's html page is, e.g.: http://jeremydorn.com/json-editor/fn_md5.json.

@cgarnier
Copy link

Got the same issue, did you find a wrokarround ?

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

No branches or pull requests

2 participants