{% assign res = "" %} {% for type in include.types %} {% if type.anyOf %} {% include type-anyof.html types=type.anyOf %} {% elsif type.type == "array" %} {% if type.items["$ref"] %} {% assign ref = type.items["$ref"] %} {% include type-ref.html ref=ref suffix="[]" %} {% elsif type.items.anyOf %} {% capture element %} {% assign para = type.items.anyOf %} {% include type-anyof.html types=para suffix="[]" %} {% endcapture %} {{ element | strip | append: include.suffix }} {% else %} {% if type.items.type == nil %} {% assign element = "Any[]" %} {% else %} {% assign element = type.items.type | strip | append: "[]" | capitalize %} {% endif %} {{element | strip | append: include.suffix}} {% endif %} {% elsif type.type %} {% if type.type.first != nil %} {% comment %}case for when type in the schema is an array of multiple types{% endcomment %} {% assign newType = "" %} {% for element in type.type %} {% assign elem = element | capitalize %} {% assign newType = newType | append: elem %} {% unless forloop.last %} {% assign newType = newType | append: " | " %} {% endunless %} {% endfor %} {% assign type = newType %} {{ newType | strip | append: include.suffix }} {% else %} {% assign element = type.type | capitalize %} {{element | strip | append: include.suffix }} {% endif%} {% elsif type["$ref"] %} {% assign ref = type["$ref"] %} {% include type-ref.html ref=ref suffix=include.suffix %} {% endif %} {% assign splitstring = " | " %} {% unless forloop.last %} {{ splitstring }} {% endunless %} {% endfor %}