Skip to content

Commit

Permalink
Merge pull request swagger-api#948 from swagger-api/swos-277
Browse files Browse the repository at this point in the history
fixed undefined issue on ref object properties.
  • Loading branch information
HugoMario authored Aug 24, 2021
2 parents 8b89683 + d2bddba commit 261c90d
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ var JSONSchemaView = (function () {
this.options = options;
this.isCollapsed = open <= 0;
if (this.schema.type == undefined && this.schema.$ref) {
const elements = this.schema.$ref.split('/');
this.schema = defs[elements.pop()];
}
// if schema is an empty object which means any JOSN
this.isAny = typeof schema === 'object' && !Array.isArray(schema) && !Object.keys(schema).filter(function (k) {
return ['title', 'description'].indexOf(k) === -1;
Expand Down

0 comments on commit 261c90d

Please sign in to comment.