diff --git a/src/editors/describedby.js b/src/editors/describedby.js index 39ac25c2c..0f46547a5 100644 --- a/src/editors/describedby.js +++ b/src/editors/describedby.js @@ -90,7 +90,7 @@ export class DescribedByEditor extends AbstractEditor { const holder = this.theme.getChildEditorHolder() this.editor_holder.appendChild(holder) - const schema = extend({}, this.schema, this.jsoneditor.refs[ref]) + const schema = extend({}, this.schema, { $ref: ref }) const editorClass = this.jsoneditor.getEditorClass(schema, this.jsoneditor) diff --git a/src/validator.js b/src/validator.js index c334aaac4..4c2caade6 100644 --- a/src/validator.js +++ b/src/validator.js @@ -720,12 +720,12 @@ export class Validator { _expandSchemaLink (schema, m) { const href = schema.links[m].href - const data = this.jsoneditor.root.getValue() + const data = this.getWatchedFieldValues() const template = this.jsoneditor.compileTemplate(href, this.jsoneditor.template) const ref = document.location.origin + document.location.pathname + template(data) schema.links = schema.links.slice(0, m).concat(schema.links.slice(m + 1)) - return extend({}, schema, this.jsoneditor.refs[ref]) + return extend({}, schema, { $ref: ref }) } _validateV3Required (schema, value, path) {