Skip to content

Commit 8c9b35a

Browse files
committed
quick fix for object title in swagger-ui
1 parent d8bf14e commit 8c9b35a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/resolver.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,10 @@ Resolver.prototype.resolveTo = function (root, property, resolutionTable, locati
638638
} else {
639639
if(property && property.properties) {
640640
var name = this.uniqueName('inline_model');
641+
if (property.title) {
642+
name = this.uniqueName(property.title);
643+
}
644+
delete property.title;
641645
this.spec.definitions[name] = _.cloneDeep(property);
642646
property['$ref'] = '#/definitions/' + name;
643647
delete property.type;

0 commit comments

Comments
 (0)