{% from "./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 %}
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() !== undefined %} >= {{prop.minimum()}} {% endif %} {% if prop.exclusiveMinimum() !== undefined %} > {{prop.exclusiveMinimum()}} {% endif %} {% if prop.maximum() !== undefined %} <= {{prop.maximum()}} {% endif %} {% if prop.exclusiveMaximum() !== undefined %} < {{prop.exclusiveMaximum()}} {% endif %} {% if prop.minItems() !== undefined %} >= {{prop.minItems()}} items {% endif %} {% if prop.maxItems() !== undefined %} <= {{prop.maxItems()}} items {% endif %} {% if prop.maxLength() !== undefined %} length <= {{prop.maxLength()}} {% endif %} {% if prop.minLength() !== undefined %} length >= {{prop.minLength()}} {% endif %} {% if prop.pattern() !== undefined %} must match {{prop.pattern()}} {% endif %} {% if prop.uniqueItems() %} Unique {% endif %}
{% if prop.description() %}
{{ prop.description() | markdown2html | safe }}
{% endif %} {% if prop.default() !== undefined %}
Default: {{prop.default() | dump}}
{% endif %} {% if prop.const() !== undefined %}
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() %} {{ schemaProp(p, pName, odd=(not odd), required=(prop.required() | includes(pName))) }} {% endfor %} {% endif %} {% set extensions = prop | nonParserExtensions %} {% if extensions.size > 0 %}

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() | includes(pName))) }} {% endfor %} {% else %} {{ schemaProp(prop.items(), '0', odd=(not odd)) }} {% endif %} {% endif %} {% if prop.additionalItems() === true or prop.additionalItems() === undefined %}

Additional items are allowed.

{% elif prop.additionalItems() === false %}

Additional items are NOT allowed.

{% else %}

Additional Items:

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

Additional properties are allowed.

{% elif prop.additionalProperties() === false %}

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 %}