From ae0e500a6598212f992c6ddc964b6dc167650068 Mon Sep 17 00:00:00 2001 From: Nemo Date: Thu, 10 Jun 2021 19:04:22 +0000 Subject: [PATCH] Adds example rendering This only supports JSON at the moment --- _includes/response.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/_includes/response.html b/_includes/response.html index a2ec115..0426026 100644 --- a/_includes/response.html +++ b/_includes/response.html @@ -1,8 +1,9 @@ {%- assign response_status_code = include.response[0] -%} -
{{ response_status_code | capitalize }} {% include utils/response_status_code.html response_status_code=response_status_code %}
+
{{ response_status_code | capitalize }} {% include utils/response_status_code.html response_status_code=response_status_code %}
   {%- for content in include.response[1].content -%}
     Content-Type: {{ content[0] }}
     {%- assign schema = content[1].schema -%}
+    {%- assign examples = content[1].examples -%}
     {%- assign slice = content[0] | slice: -4, 4 | downcase -%}
     
       {%- if slice == 'json' -%}
@@ -11,5 +12,8 @@
         {{- schema -}}
       {%- endif -%}
     
+    {%- for example in examples -%}
+      Example: {{ example[0] }}{{example[1].value|jsonify}}
+    {%- endfor -%}
   {%- endfor -%}
-
\ No newline at end of file +