Skip to content

Commit

Permalink
openapi3; tidy position of xmlWrap checking
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeRalphson committed Sep 28, 2017
1 parent ee076a6 commit 333e86d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion openapi3.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,12 @@ function processOperation(op, method, resource, options) {
content += '```\n';
}
if (common.doContentType(consumes, common.xmlContentTypes) && (typeof obj === 'object')) {
content += '```xml\n';
if (xmlWrap) {
var newObj = {};
newObj[xmlWrap] = obj;
obj = newObj;
}
content += '```xml\n';
content += xml.getXml(obj, '@', '', true, ' ', false) + '\n';
content += '```\n';
}
Expand Down Expand Up @@ -495,6 +495,7 @@ function processOperation(op, method, resource, options) {
console.error(ex);
}
}
// TODO support embedded/reffed examples
if (common.doContentType(cta, common.jsonContentTypes)) {
content += '```json\n';
content += JSON.stringify(obj, null, 2) + '\n';
Expand Down

0 comments on commit 333e86d

Please sign in to comment.