{% from "./partials/type.html" import type %} {% macro schemaProp(prop, propName, open=false, root=false, odd=false, specialName=false, required=false) %}
{{propName}} {% if prop | isExpandable %} {% endif %} {% if required and required is not none%}
required
{% endif %} {% if prop.deprecated() %}
deprecated
{% endif %}
{{ type(prop) }} {% if prop.anyOf() %}anyOf{% endif %} {% if prop.oneOf() %}oneOf{% endif %} {% if prop.allOf() %}allOf{% endif %}
{% if prop.format() %} {{prop.format()}} {% endif %} {% if prop.minimum() is not none %} >= {{prop.minimum()}} {% endif %} {% if prop.exclusiveMinimum() is not none %} > {{prop.exclusiveMinimum()}} {% endif %} {% if prop.maximum() is not none %} <= {{prop.maximum()}} {% endif %} {% if prop.exclusiveMaximum() is not none %} < {{prop.exclusiveMaximum()}} {% endif %} {% if prop.minItems() is not none %} >= {{prop.minItems()}} items {% endif %} {% if prop.maxItems() is not none %} <= {{prop.maxItems()}} items {% endif %} {% if prop.maxLength() is not none %} length <= {{prop.maxLength()}} {% endif %} {% if prop.minLength() is not none %} length >= {{prop.minLength()}} {% endif %} {% if prop.pattern() is not none %} must match {{prop.pattern()}} {% endif %} {% if prop.uniqueItems() %} Unique {% endif %}
{% if prop.description() %}
{{ prop.description() | markdown2html | safe }}
{% endif %} {% if prop.default() is not none %}
Default: {{prop.default() | dump}}
{% endif %} {% if prop.const() is not none %}
Const: {{prop.const() | dump}}
{% endif %} {% if prop.enum() %}
Enum: {% for value in prop.enum() %} {{value | dump(2) | safe }} {% endfor %}
{% endif %} {% if prop.examples() %}
Examples: {% for value in prop.examples() %} {{value | dump(2) | safe }} {% endfor %}
{% endif %}
{% if prop | isExpandable %}
{% if prop.properties() %} {% for pName, p in prop.properties() %} {% if prop.required() and pName in prop.required() %} {{ schemaProp(p, pName, odd=(not odd), required=true) }} {% else %} {{ schemaProp(p, pName, odd=(not odd), required=false) }} {% endif %} {% endfor %} {% endif %} {% set extensions = prop | nonParserExtensions %} {% if extensions %}

Specification Extensions:

{% for extensionName, extensionValue in extensions %}
{% if extensionValue | isObject %}
{{ extensionName }}
{{ extensionValue | dump(2) }}
{% else %}
{{ extensionName }}: {{ extensionValue }}
{% endif %}
{% endfor %} {% endif %} {% if prop.type() == 'array' %} {% if prop.items() %}

Items:

{% if prop.items() | isArray %} {% for it in prop.items() %} {{ schemaProp(it, loop.index0, odd=(not odd), required=prop.required()|boolean) }} {% endfor %} {% else %} {{ schemaProp(prop.items(), '0', odd=(not odd)) }} {% endif %} {% endif %} {% if prop.additionalItems() is true or prop.additionalItems() is none %}

Additional items are allowed.

{% elif prop.additionalItems() is false and prop.additionalItems() is not none %}

Additional items are NOT allowed.

{% else %}

Additional Items:

{{ schemaProp(prop.additionalItems(), '', odd=(not odd)) }}
{% endif %} {% endif %} {% if prop.type() == 'object' %} {% if prop.additionalProperties() is true or prop.additionalProperties() is none %}

Additional properties are allowed.

{% elif prop.additionalProperties() is false and prop.additionalProperties() is not none %}

Additional properties are NOT allowed.

{% else %}

Additional properties must adhere to the following schema:

{{ schemaProp(prop.additionalProperties(), '(property name)', odd=(not odd), open=false, specialName=true) }}
{% endif %} {% endif %} {% if prop.oneOf() %} {% for p in prop.oneOf() %} {{ schemaProp(p, loop.index0, odd=(not odd)) }} {% endfor %} {% endif %} {% if prop.anyOf() %} {% for p in prop.anyOf() %} {{ schemaProp(p, loop.index0, odd=(not odd)) }} {% endfor %} {% endif %} {% if prop.allOf() %} {% for p in prop.allOf() %} {{ schemaProp(p, loop.index0, odd=(not odd)) }} {% endfor %} {% endif %}
{% endif %}
{% endmacro %}