Skip to content

Commit

Permalink
Merge pull request #654 from illicitonion/spuriousdiv
Browse files Browse the repository at this point in the history
Remove spurious </div> from empty object response schema
  • Loading branch information
fehguy committed Dec 8, 2015
2 parents c1c60d4 + ab9f2fa commit 1379944
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions browser/swagger-client.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion browser/swagger-client.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions lib/schema-markup.js
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ function schemaToHTML(name, schema, models, modelPropertyMacro) {
html += '<div>' + addReference(schema, name) + '</div>';
} else if (type === 'object') {
if (_.isPlainObject(schema.properties)) {
html += _.map(schema.properties, function (property, name) {
var contents = _.map(schema.properties, function (property, name) {
var propertyIsRequired = (_.indexOf(schema.required, name) >= 0);
var cProperty = _.cloneDeep(property);

Expand Down Expand Up @@ -520,7 +520,9 @@ function schemaToHTML(name, schema, models, modelPropertyMacro) {
}).join(',</div>');
}

html += '</div>';
if (contents) {
html += contents + '</div>';
}
} else {
html += '<div>' + primitiveToOptionsHTML(schema, type) + '</div>';
}
Expand Down

0 comments on commit 1379944

Please sign in to comment.