Permalink
Browse files

Fixed template render error (#272)

  • Loading branch information...
1 parent 37b43cd commit eee936c029ec3b081fb0954fd9f5dd36586033bd @kevinrenskers kevinrenskers committed Nov 2, 2016
Showing with 9 additions and 6 deletions.
  1. +3 −0 changelog.md
  2. +1 −1 examples/arrayitems.html
  3. +1 −1 examples/world-music-api.html
  4. +1 −1 index.js
  5. +2 −2 lib/resource.nunjucks
  6. +1 −1 package.json
View
@@ -1,3 +1,6 @@
+4.0.0-beta14 - November 3, 2016
+- Fixed template render error (#272)
+
4.0.0-beta13 - November 2, 2016
- Updated raml2obj to 4.0.0-beta13, fixing type expansion in uriParameters (#271)
@@ -1,4 +1,4 @@
-<!DOCTYPE HTML><html><head><title>Test API documentation</title><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="generator" content="https://github.com/raml2html/raml2html 4.0.0-beta12"><link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.3.0/styles/default.min.css"><script type="text/javascript" src="https://code.jquery.com/jquery-1.11.0.min.js"></script><script type="text/javascript" src="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.3.0/highlight.min.js"></script><script type="text/javascript">
+<!DOCTYPE HTML><html><head><title>Test API documentation</title><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="generator" content="https://github.com/raml2html/raml2html 4.0.0-beta13"><link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.3.0/styles/default.min.css"><script type="text/javascript" src="https://code.jquery.com/jquery-1.11.0.min.js"></script><script type="text/javascript" src="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.3.0/highlight.min.js"></script><script type="text/javascript">
$(document).ready(function() {
$('.page-header pre code, .top-resource-description pre code, .modal-body pre code').each(function(i, block) {
hljs.highlightBlock(block);
@@ -1,4 +1,4 @@
-<!DOCTYPE HTML><html><head><title>World Music API API documentation</title><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="generator" content="https://github.com/raml2html/raml2html 4.0.0-beta12"><link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.3.0/styles/default.min.css"><script type="text/javascript" src="https://code.jquery.com/jquery-1.11.0.min.js"></script><script type="text/javascript" src="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.3.0/highlight.min.js"></script><script type="text/javascript">
+<!DOCTYPE HTML><html><head><title>World Music API API documentation</title><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="generator" content="https://github.com/raml2html/raml2html 4.0.0-beta13"><link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.3.0/styles/default.min.css"><script type="text/javascript" src="https://code.jquery.com/jquery-1.11.0.min.js"></script><script type="text/javascript" src="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.3.0/highlight.min.js"></script><script type="text/javascript">
$(document).ready(function() {
$('.page-header pre code, .top-resource-description pre code, .modal-body pre code').each(function(i, block) {
hljs.highlightBlock(block);
View
@@ -26,7 +26,7 @@ function render(source, config) {
ramlObj.config = config;
ramlObj.isStandardType = function (type) {
- if (type.properties) {
+ if (typeof type === 'object') {
return false;
}
return type.indexOf('{') === -1 && type.indexOf('<') === -1;
@@ -179,7 +179,7 @@
<pre><code>{{ b.content | escape }}</code></pre>
{% endif %}
- {% if b.items %}
+ {% if b.items and b.items.properties %}
{% if isStandardType(b.items) %}
<p><strong>Items</strong>: {{ b.items }}</p>
{% endif %}
@@ -261,7 +261,7 @@
<pre><code>{{ b.content | escape }}</code></pre>
{% endif %}
- {% if b.items %}
+ {% if b.items and b.items.properties %}
{% if isStandardType(b.items) %}
<p><strong>Items</strong>: {{ b.items }}</p>
{% endif %}
View
@@ -1,7 +1,7 @@
{
"name": "raml2html",
"description": "RAML to HTML documentation generator",
- "version": "4.0.0-beta13",
+ "version": "4.0.0-beta14",
"author": {
"name": "Kevin Renskers",
"email": "info@mixedcase.nl"

0 comments on commit eee936c

Please sign in to comment.