From b5f43a725778d0e72bf93594512f93d38dd5bb49 Mon Sep 17 00:00:00 2001 From: tdakanalis Date: Thu, 31 Mar 2016 15:32:44 +0300 Subject: [PATCH] Handling Of Composite Types Made a small fix in the handling of the oneOf, anyOf and allOf composite types --- src/js/Node.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/Node.js b/src/js/Node.js index 813b0b7..91ab55e 100644 --- a/src/js/Node.js +++ b/src/js/Node.js @@ -1942,7 +1942,7 @@ Node.prototype.updateDom = function (options) { //We expect in the enumLabels attribute of a json schema property the labels for the enum values //in the same order as the respective elements in the enum array. Otherwise, use the enum values //as labels. - var enumLabels = (this.schema.hasOwnProperty('enumLabels') && this.schema.enumLabels != undefined) ? + var enumLabels = (this.schema.hasOwnProperty('enumLabels') && this.schema.enumLabels !== undefined) ? this.schema.enumLabels : this.schema.enum; this.enum = {'enum': this.schema.enum, 'enumLabels' : enumLabels}; } else { @@ -1956,8 +1956,8 @@ Node.prototype.updateDom = function (options) { this.enum = this._getJsonObject(this.schema.allOf, 'enum')[0]; } - if(this.schema.enum !== undefined && !this.schema.enum.hasOwnProperty('enumLabels')){ - this.schema.enum.enumLabels = this.schema.enum.enum; + if(this.enum !== undefined && !this.enum.hasOwnProperty('enumLabels')){ + this.enum.enumLabels = this.enum.enum; } } }