Skip to content

Commit

Permalink
Handling Of Composite Types
Browse files Browse the repository at this point in the history
Made a small fix in the handling of the oneOf, anyOf and allOf composite types
  • Loading branch information
tdakanalis committed Mar 31, 2016
1 parent dd67954 commit b5f43a7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/js/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
}
}
}
Expand Down

0 comments on commit b5f43a7

Please sign in to comment.