Skip to content

Commit

Permalink
quick fix for object title in swagger-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
philippone committed Feb 26, 2016
1 parent d8bf14e commit 8c9b35a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,10 @@ Resolver.prototype.resolveTo = function (root, property, resolutionTable, locati
} else {
if(property && property.properties) {
var name = this.uniqueName('inline_model');
if (property.title) {
name = this.uniqueName(property.title);
}
delete property.title;
this.spec.definitions[name] = _.cloneDeep(property);
property['$ref'] = '#/definitions/' + name;
delete property.type;
Expand Down

1 comment on commit 8c9b35a

@fehguy
Copy link
Contributor

@fehguy fehguy commented on 8c9b35a Mar 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.