From feeca8c8a063758bdec26b8a3314b8d54a81bb49 Mon Sep 17 00:00:00 2001 From: Joakim Hedlund Date: Fri, 24 Mar 2017 10:35:18 +0100 Subject: [PATCH] Include expanded schemas options to include refs --- src/editor.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/editor.js b/src/editor.js index 7993f783e..ca3033af7 100644 --- a/src/editor.js +++ b/src/editor.js @@ -39,9 +39,9 @@ JSONEditor.AbstractEditor = Class.extend({ this.original_schema = options.schema; this.schema = this.jsoneditor.expandSchema(this.original_schema); - - this.options = $extend({}, (this.options || {}), (options.schema.options || {}), options); - + + this.options = $extend({}, (this.options || {}), (this.schema.options || {}), (options.schema.options || {}), options); + if(!options.path && !this.schema.id) this.schema.id = 'root'; this.path = options.path || 'root'; this.formname = options.formname || this.path.replace(/\.([^.]+)/g,'[$1]');