Changeset View
Changeset View
Standalone View
Standalone View
swh/web/templates/api/apidoc.html
Show All 13 Lines | |||||
{% block navbar-content %} | {% block navbar-content %} | ||||
<nav class="bread-crumbs"> | <nav class="bread-crumbs"> | ||||
<ul> | <ul> | ||||
<li><a href="/api/"><h4>Web API</h4></a></li> | <li><a href="/api/"><h4>Web API</h4></a></li> | ||||
<li class="bc-no-root"><i class="fa fa-caret-right fa-fw" aria-hidden="true"></i></li> | <li class="bc-no-root"><i class="fa fa-caret-right fa-fw" aria-hidden="true"></i></li> | ||||
<li class="bc-no-root"><a href="/api/1/">endpoints</a></li> | <li class="bc-no-root"><a href="/api/1/">endpoints</a></li> | ||||
{% for endpoint in endpoint_path %} | {% for endpoint in endpoint_path %} | ||||
<li class="bc-no-root"><i class="fa fa-caret-right fa-fw" aria-hidden="true"></i></li> | <li class="bc-no-root"><i class="fa fa-caret-right fa-fw" aria-hidden="true"></i></li> | ||||
{% if endpoint.name != 'stat' and endpoint.name != 'vault' and endpoint.path != 'vault/revision' %} | {% if endpoint.name != 'stat' and endpoint.name != 'vault' and endpoint.path != 'vault/revision/doc/' %} | ||||
<li class="bc-no-root"><a href="{{ '/api/1/'|add:endpoint.path }}">{{ endpoint.name }}</a></li> | <li class="bc-no-root"><a href="{{ '/api/1/'|add:endpoint.path }}">{{ endpoint.name }}</a></li> | ||||
{% else %} | {% else %} | ||||
<li class="bc-no-root"><span>{{ endpoint.name }}</span></li> | <li class="bc-no-root"><span>{{ endpoint.name }}</span></li> | ||||
{% endif %} | {% endif %} | ||||
{% endfor %} | {% endfor %} | ||||
</ul> | </ul> | ||||
</nav> | </nav> | ||||
{% endblock %} | {% endblock %} | ||||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | <h4> Request headers </h4> | ||||
<dl class="row"> | <dl class="row"> | ||||
<dt class="col col-md-2 text-right"> {{ header.name }} </dt> | <dt class="col col-md-2 text-right"> {{ header.name }} </dt> | ||||
<dd class="col col-md-9"> {{ header.doc | safe_docstring_display | safe }} </dd> | <dd class="col col-md-9"> {{ header.doc | safe_docstring_display | safe }} </dd> | ||||
</dl> | </dl> | ||||
{% endfor %} | {% endfor %} | ||||
</div> | </div> | ||||
<hr/> | <hr/> | ||||
{% endif %} | {% endif %} | ||||
{% if input_type %} | |||||
<div> | |||||
<h4> Request data </h4> | |||||
<dl class="row"> | |||||
<dt class="col col-md-2 text-right"> {{ input_type }} </dt> | |||||
<dd class="col col-md-9"> | |||||
<p> | |||||
{% if input_type == 'array' and inputs_list == '' %} | |||||
{{ inputs.0.doc | safe }} | |||||
{% elif input_type == 'array' and inputs_list != '' %} | |||||
an array of objects containing the following keys: | |||||
{% elif input_type == 'octet stream' %} | |||||
raw data as an octet stream | |||||
{% elif input_type == 'object' %} | |||||
an object containing the following keys: | |||||
{% endif %} | |||||
{% if inputs_list != '' %} | |||||
{{ inputs_list | safe_docstring_display | safe }} | |||||
{% endif %} | |||||
</p> | |||||
</dd> | |||||
</dl> | |||||
</div> | |||||
<hr/> | |||||
{% endif %} | |||||
{% if resheaders and resheaders|length > 0 %} | {% if resheaders and resheaders|length > 0 %} | ||||
<div> | <div> | ||||
<h4> Response headers </h4> | <h4> Response headers </h4> | ||||
{% for header in resheaders %} | {% for header in resheaders %} | ||||
<dl class="row"> | <dl class="row"> | ||||
<dt class="col col-md-2 text-right"> {{ header.name }} </dt> | <dt class="col col-md-2 text-right"> {{ header.name }} </dt> | ||||
<dd class="col col-md-9"> {{ header.doc | safe_docstring_display | safe }} </dd> | <dd class="col col-md-9"> {{ header.doc | safe_docstring_display | safe }} </dd> | ||||
</dl> | </dl> | ||||
{% endfor %} | {% endfor %} | ||||
</div> | </div> | ||||
<hr/> | <hr/> | ||||
{% endif %} | {% endif %} | ||||
{% if return_type %} | {% if return_type %} | ||||
<div> | <div> | ||||
<h4> Returns </h4> | <h4> Returns </h4> | ||||
<dl class="row"> | <dl class="row"> | ||||
<dt class="col col-md-2 text-right"> {{ return_type }} </dt> | <dt class="col col-md-2 text-right"> {{ return_type }} </dt> | ||||
<dd class="col col-md-9"> | <dd class="col col-md-9"> | ||||
<p> | <p> | ||||
{% if return_type == 'array' %} | {% if return_type == 'array' and returns_list == '' %} | ||||
{{ returns.0.doc | safe }} | |||||
{% elif return_type == 'array' and returns_list != '' %} | |||||
an array of objects containing the following keys: | an array of objects containing the following keys: | ||||
{% elif return_type == 'octet stream' %} | {% elif return_type == 'octet stream' %} | ||||
the raw data as an octet stream | raw data as an octet stream | ||||
{% else %} | {% elif return_type == 'object' %} | ||||
an object containing the following keys: | an object containing the following keys: | ||||
{% endif %} | {% endif %} | ||||
{% if returns_list != '' %} | |||||
{{ returns_list | safe_docstring_display | safe }} | {{ returns_list | safe_docstring_display | safe }} | ||||
{% endif %} | |||||
</p> | </p> | ||||
</dd> | </dd> | ||||
</dl> | </dl> | ||||
</div> | </div> | ||||
<hr/> | <hr/> | ||||
{% endif %} | {% endif %} | ||||
{% if status_codes and status_codes|length > 0 %} | {% if status_codes and status_codes|length > 0 %} | ||||
<div> | <div> | ||||
Show All 30 Lines |