Permalink
Browse files

Fix generic error type (#302)

  • Loading branch information...
1 parent ecba7df commit 1a1bbef06a34b553ea1df3b1a9b8ede9bfae326c @zerok zerok committed with kevinrenskers Jan 9, 2017
Showing with 16 additions and 2 deletions.
  1. +14 −0 examples/array-generic.raml
  2. +2 −2 lib/resource.nunjucks
@@ -0,0 +1,14 @@
+#%RAML 1.0
+title: API used to test broken features
+version: v1
+baseUri: http://api.samplehost.com/broken/{version}
+mediaType: application/json
+protocols: [HTTP, HTTPS]
+
+/:
+ get:
+ responses:
+ 200:
+ body:
+ type: array
+ example: ["somevalue","anothervalue"]
@@ -165,7 +165,7 @@
{% if b.type %}
{% if isStandardType(b.type) %}
- {% if b.type === 'array' %}
+ {% if b.type === 'array' and b.items %}
<p><strong>Type</strong>: array of {% if isStandardType(b.items) %}{{ b.items }}{% else %}{{ b.items.displayName }}{% endif %}</p>
{% else %}
<p><strong>Type</strong>: {{ b.type }}</p>
@@ -260,7 +260,7 @@
{% if b.type %}
{% if isStandardType(b.type) %}
- {% if b.type === 'array' %}
+ {% if b.type === 'array' and b.items %}
<p><strong>Type</strong>: array of {% if isStandardType(b.items) %}{{ b.items }}{% else %}{{ b.items.displayName }}{% endif %}</p>
{% else %}
<p><strong>Type</strong>: {{ b.type }}</p>

0 comments on commit 1a1bbef

Please sign in to comment.