This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresource.nunjucks
50 lines (46 loc) · 1.47 KB
/
resource.nunjucks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{% if (resource.methods or (resource.description and resource.parentUrl)) %}
h3. {{ resource.parentUrl }}{{ resource.relativeUri }}
{% if resource.parentUrl %}{{ resource.description }}{% endif %}
{% if resource.allUriParameters.length %}
{% set headerOutput = false %}
{% for item in resource.allUriParameters %}
{%- if not item.structuredValue -%}
{%- if not headerOutput -%}
{% set headerOutput = true %}
|| Name || Required || Type || Description ||
{% endif -%}
{%- set isPathParam = true -%}
| {% include "./item.nunjucks" %} |
{% else -%}
| {{ item.structuredValue | dump }} ||||
{% endif -%}
{%- endfor -%}
{% endif %}
{% for method in resource.methods %}
h4. {{ method.method}} {% if method.securedBy %} *(secured)*{% endif %}
{{ method.description }}
{% if method.queryString and method.queryString.properties.length %}
{% set headerOutput = false %}
{% for item in method.queryString.properties %}
{%- if not headerOutput -%}
{% set headerOutput = true %}
|| Name || Required || Type || Description ||
{% endif -%}
| {% include "./item.nunjucks" %} |
{% endfor -%}
{%- endif -%}
{% if method.queryParameters.length %}
{% set headerOutput = false %}
{% for item in method.queryParameters %}
{%- if not headerOutput -%}
{% set headerOutput = true %}
|| Name || Required || Type || Description ||
{% endif -%}
| {% include "./item.nunjucks" %} |
{% endfor -%}
{%- endif -%}
{%- endfor -%}
{% endif %}
{% for resource in resource.resources %}
{% include "./resource.nunjucks" %}
{% endfor %}