Skip to content

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.

1 participant