# {{schema.title or schema.id}}

{% if schema.description %}
{{schema.description}}
{% endif %}

{% for key, value in schema.iteritems() %}
    {% if value | type(dict) and value.params %}
---
### {{value.title or key}}
        {% if value.description %}

{{value.description}}
        {% endif %}

        {% with subschema = value.params, key = "params", indentlvl = 1 %}
        {# this is json-schema for method params #}
{% include "docs_subschema.j2" %}
        {% endwith %}
        {% if value.result %}
        {# result schema is optional #}

            {% with subschema = value.result, key = "result", indentlvl = 1 %}
            {# this is json-schema for method result #}
{% include "docs_subschema.j2" %}
            {% endwith %}
        {% endif %}
    {% elif value | type(dict) %}
---
        {% with subschema = value, key = key, indentlvl = 0 %}
        {# this is json-shema #}
{% include "docs_subschema.j2" %}
        {% endwith %}
    {% endif %}
{% endfor %}
