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 describedby #1344

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/editors/describedby.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions src/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down