From 2d53247d72453cd44590900fc1f20c6f879dd69a Mon Sep 17 00:00:00 2001 From: Hsiaoyi Hsu Date: Wed, 10 Jun 2015 16:31:00 +0800 Subject: [PATCH 1/3] add: format req body and res body --- APIBlueprintGenerator.coffee | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/APIBlueprintGenerator.coffee b/APIBlueprintGenerator.coffee index 63f989b..d1356b9 100644 --- a/APIBlueprintGenerator.coffee +++ b/APIBlueprintGenerator.coffee @@ -26,8 +26,11 @@ APIBlueprintGenerator = -> body_indentation = ' ' if has_headers body_indentation += ' ' + try + body = JSON.stringify(JSON.parse(body), null, 2) body = body.replace(/^/gm, body_indentation) + return { statusCode: exchange.responseStatusCode, contentType: exchange.responseHeaders['Content-Type'], @@ -58,6 +61,8 @@ APIBlueprintGenerator = -> body_indentation = ' ' if has_headers body_indentation += ' ' + try + body = JSON.stringify(JSON.parse(body), null, 2) body = body.replace(/^/gm, body_indentation) if has_headers || has_body || paw_request.headers['Content-Type'] From 82691b4c7fa9c038b371a88403c2d7065118aa59 Mon Sep 17 00:00:00 2001 From: Hsiaoyi Hsu Date: Thu, 11 Jun 2015 16:37:33 +0800 Subject: [PATCH 2/3] add: body is empty if return status 200 --- APIBlueprintGenerator.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/APIBlueprintGenerator.coffee b/APIBlueprintGenerator.coffee index d1356b9..b0e9c10 100644 --- a/APIBlueprintGenerator.coffee +++ b/APIBlueprintGenerator.coffee @@ -28,6 +28,7 @@ APIBlueprintGenerator = -> body_indentation += ' ' try body = JSON.stringify(JSON.parse(body), null, 2) + body = "" if body is "OK" body = body.replace(/^/gm, body_indentation) From 4f775975295e3ade3a4779185bcb6769e134a5e5 Mon Sep 17 00:00:00 2001 From: Hsiaoyi Hsu Date: Fri, 12 Jun 2015 05:18:55 +0800 Subject: [PATCH 3/3] change: method and path from h1 to bold --- apiblueprint.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apiblueprint.mustache b/apiblueprint.mustache index 0fc72ad..5ab57ed 100644 --- a/apiblueprint.mustache +++ b/apiblueprint.mustache @@ -1,4 +1,4 @@ -# {{{ method }}} {{{ path }}} +**{{{ method }}} {{{ path }}}** {{#request}} + Request{{#contentType}} ({{{contentType}}}){{/contentType}}