Skip to content

Commit 261c90d

Browse files
authored
Merge pull request #948 from swagger-api/swos-277
fixed undefined issue on ref object properties.
2 parents 8b89683 + d2bddba commit 261c90d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/resources/handlebars/htmlDocs2/js_jsonschemaview.mustache

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@ var JSONSchemaView = (function () {
122122
this.options = options;
123123
this.isCollapsed = open <= 0;
124124
125+
if (this.schema.type == undefined && this.schema.$ref) {
126+
const elements = this.schema.$ref.split('/');
127+
this.schema = defs[elements.pop()];
128+
}
129+
125130
// if schema is an empty object which means any JOSN
126131
this.isAny = typeof schema === 'object' && !Array.isArray(schema) && !Object.keys(schema).filter(function (k) {
127132
return ['title', 'description'].indexOf(k) === -1;

0 commit comments

Comments
 (0)