diff --git a/apistar/themes/apistar/templates/layout/examples.html b/apistar/themes/apistar/templates/layout/examples.html
index 87c8d40b..5cd478bc 100644
--- a/apistar/themes/apistar/templates/layout/examples.html
+++ b/apistar/themes/apistar/templates/layout/examples.html
@@ -1,20 +1,18 @@
-{% for field in fields %}
- {% if field.examples %}
-
Examples
- parameter: {{ field.name }}
-
-
- Name | Value | Summary |
-
-
- {% for name, example in field.examples.items() %}
-
- {{ name }} |
- {{ example.value|pprint }} |
- {% if example.summary %}{{ example.summary }}{% endif %} |
-
- {% endfor %}
-
-
- {% endif %}
-{% endfor %}
+{% if examples %}
+ Examples
+ parameter: {{ field.name }}
+
+
+ Name | Value | Summary |
+
+
+ {% for name, example in examples.items() %}
+
+ {{ name }} |
+ {{ example.value|pprint }} |
+ {% if example.summary %}{{ example.summary }}{% endif %} |
+
+ {% endfor %}
+
+
+{% endif %}
\ No newline at end of file
diff --git a/apistar/themes/apistar/templates/layout/link.html b/apistar/themes/apistar/templates/layout/link.html
index cffbfc15..602d0a33 100644
--- a/apistar/themes/apistar/templates/layout/link.html
+++ b/apistar/themes/apistar/templates/layout/link.html
@@ -24,7 +24,11 @@ Path Parameters
{% endfor %}
- {% include 'apistar/layout/examples.html' %}
+ {% for field in fields %}
+ {% with examples=field.examples %}
+ {% include 'apistar/layout/examples.html' %}
+ {% endwith %}
+ {% endfor %}
{% endwith %}
{% endif %}
{% if link.get_query_fields() %}
@@ -41,7 +45,11 @@ Query Parameters
{% endfor %}
- {% include 'apistar/layout/examples.html' %}
+ {% for field in fields %}
+ {% with examples=field.examples %}
+ {% include 'apistar/layout/examples.html' %}
+ {% endwith %}
+ {% endfor %}
{% endwith %}
{% endif %}
{% if link.get_body_field() %}
@@ -63,6 +71,9 @@ Request Body
{% endif %}
+ {% with examples=field.examples %}
+ {% include 'apistar/layout/examples.html' %}
+ {% endwith %}
{% endif %}