From bfa973f49c7a0515a61c791bd63e9d5069f783f2 Mon Sep 17 00:00:00 2001 From: Blake Visin Date: Mon, 25 Jan 2016 14:26:49 -0800 Subject: [PATCH] Allow header OR body overwrite in response md Sorta related to #3. It looks like I can overwrite the mark down template output by setting `response_example` in the JSON schema link. But I have to overwrite the returned headers AND body. This would allow me to simply overwrite the response headers OR body, or both. --- lib/prmd/templates/schemata/link.md.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/prmd/templates/schemata/link.md.erb b/lib/prmd/templates/schemata/link.md.erb index ee41f60..544f6f3 100644 --- a/lib/prmd/templates/schemata/link.md.erb +++ b/lib/prmd/templates/schemata/link.md.erb @@ -47,7 +47,7 @@ #### Response Example ``` -<%- if response_example %> +<%- if response_example.has_key?('head') %> <%= response_example['head'] %> <%- else %> HTTP/1.1 <%= @@ -62,9 +62,9 @@ HTTP/1.1 <%= <%- end %> ``` -<%- if response_example || link['rel'] != 'empty' %> +<%- if response_example.has_key?('body') || link['rel'] != 'empty' %> ```json -<%- if response_example %> +<%- if response_example.has_key?('body') %> <%= response_example['body'] %> <%- else %> <%- if link['rel'] == 'empty' %>