{% assign src = include.source %} {% assign type = src.type %} {% if type == nil %} {% if src["$ref"] %} {% assign ref = src["$ref"] %} {% include type-ref.html ref=ref %} {% elsif src.anyOf %} {% assign para = src.anyOf %} {% include type-anyof.html types=para %} {% else %} Any {% endif %} {% elsif type == "array" %} {% if src.items.anyOf %} {% assign para = src.items.anyOf %} {% include type-anyof.html types=para suffix="[]"%} {% elsif src.items.size > 1 %} {% capture content %} {% for element in src.items %} {% capture c %}{% include type.html source=element %}{% endcapture c %} {{ c | strip }}{% unless forloop.last %},{% endunless %}{% endfor %} {% endcapture content %} [{{ content | strip }}] {% else %} {% include type.html source=src.items parentheses=true %}[] {% endif %} {% elsif type == "object" %} {% include type.html source=src.additionalProperties %}{} {% elsif type.first != nil %} {% comment %}case for when type in the schema is an array of multiple types{% endcomment %} {% capture content %} {% for element in type %} {{ element | capitalize | strip }} {% unless forloop.last %} | {% endunless %} {% endfor %} {% endcapture content %} {% if include.parentheses %} ({{ content | strip }}) {% else %} {{ content }} {% endif %} {% else %} {%comment%}normal case for single type{%endcomment%} {{ type | capitalize | strip}} {% endif %}