From 333e86d944c4f18fb361f2fcaad0bad48317ea4f Mon Sep 17 00:00:00 2001 From: Mike Ralphson Date: Thu, 28 Sep 2017 11:03:29 +0100 Subject: [PATCH] openapi3; tidy position of xmlWrap checking --- openapi3.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openapi3.js b/openapi3.js index bf96b281..5b5af92a 100644 --- a/openapi3.js +++ b/openapi3.js @@ -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'; } @@ -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';