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

Fix to expand refs before creating root editor #614

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ianmetcalf
Copy link

I ran into an issue when using $ref in the root schema, where the schema in the file referenced doesn't get expanded. Here is an example that reproduces this:

var editor = new JSONEditor(element, {
  ajax: true,
  schema: {
    $ref: '/schema/a.json',
  }
});
{
  "id": "/schema/a.json",
  "oneOf": [
    {
      "$ref": "/schema/b.json"
    },
    {
      "$ref": "/schema/c.json"
    }
  ]
}

I fixed this be expanding the refs in the root schema before instantiating the root editor.

Also, I had to use node v0.10 in order to run grunt. You may want to make a note of that in the README or upgrade the grunt jshint package to support newer versions of node.

@ianmetcalf ianmetcalf changed the title Fixed to expand refs before creating root editor Fix to expand refs before creating root editor May 30, 2016
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

Successfully merging this pull request may close these issues.

None yet

1 participant