Handling Of Composite Types

Made a small fix in the handling of the oneOf, anyOf and allOf composite types
This commit is contained in:
tdakanalis 2016-03-31 15:32:44 +03:00
parent dd679542af
commit b5f43a7257
1 changed files with 3 additions and 3 deletions

View File

@ -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 //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 //in the same order as the respective elements in the enum array. Otherwise, use the enum values
//as labels. //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.schema.enumLabels : this.schema.enum;
this.enum = {'enum': this.schema.enum, 'enumLabels' : enumLabels}; this.enum = {'enum': this.schema.enum, 'enumLabels' : enumLabels};
} else { } else {
@ -1956,8 +1956,8 @@ Node.prototype.updateDom = function (options) {
this.enum = this._getJsonObject(this.schema.allOf, 'enum')[0]; this.enum = this._getJsonObject(this.schema.allOf, 'enum')[0];
} }
if(this.schema.enum !== undefined && !this.schema.enum.hasOwnProperty('enumLabels')){ if(this.enum !== undefined && !this.enum.hasOwnProperty('enumLabels')){
this.schema.enum.enumLabels = this.schema.enum.enum; this.enum.enumLabels = this.enum.enum;
} }
} }
} }