-
Notifications
You must be signed in to change notification settings - Fork 5
/
securityScheme.nunjucks
134 lines (121 loc) · 5.16 KB
/
securityScheme.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
{% set secSchemeAnchor = "security-schemes:" + secSchemeKey %}
<article class="record record--sec-scheme" id="{{ secSchemeAnchor }}">
<header class="record__header section">
<h3 class="record__header__title section__content">
<span class="record__header__method">Security Scheme</span>
<span class="record__header__label">
<span class="record__header__name">{{ secScheme.name }}</span>
</span>
</h3>
<div class="section__sidecode section__sidecode--heading">
<span class="record__header__altname">{% if secScheme.displayName %}{{ secScheme.displayName }}{% endif %}</span>
</div>
</header>
<section class="record__content">
<!-- Common -->
<div class="section-group section-group--separated">
<div class="section">
<div class="section__content container container--inner">
<!-- <pre><code>{{ type | dump }}</code></pre> -->
<!-- Description -->
{% if secScheme.description %}
<div class="content-group">
<div class="rtc rtc--final">
{% markdown %}
{{ secScheme.description}}
{% endmarkdown %}
</div>
</div>
{% endif %}
<!-- Headers -->
{% if secScheme.describedBy.headers.length %}
<div class="content-group" id="{{ secSchemeAnchor }}:headers">
<h3 class="content-group__title collapsible__toggler collapsible__head" data-target="{{ secSchemeAnchor }}:headers">
<span class="content-group__title__label">Headers</span>
{{ partials.collapsibleArrows() }}
</h3>
<table class="table collapsible__el">
{{ partials.paramsHeader() }}
{{ partials.paramsBody(secScheme.describedBy.headers, types) }}
</table>
</div>
{% endif %}
<!-- Params -->
{% if secScheme.describedBy.queryParameters %}
<div class="content-group" id="{{ secSchemeAnchor }}:queryParams">
<h3 class="content-group__title collapsible__toggler collapsible__head" data-target="{{ secSchemeAnchor }}:queryParams">
<span class="content-group__title__label">Query Parameters</span>
{{ partials.collapsibleArrows() }}
</h3>
<table class="table collapsible__el">
{{ partials.paramsHeader() }}
{{ partials.paramsBody(secScheme.describedBy.queryParameters, types) }}
</table>
</div>
{% endif %}
<!-- Annotations -->
{% if secScheme.annotations.length %}
<div class="content-group collapsible--collapsed" id="{{ secSchemeAnchor }}:annotations">
<h3 class="content-group__title collapsible__toggler collapsible__head" data-target="{{ typeAnchor }}:annotations">
<span class="content-group__title__label">Annotations</span>
{{ partials.collapsibleArrows() }}
</h3>
<ul class="record__annotations collapsible__el">
{% for item in secScheme.annotations %}
<li class="record__annotations__item">
<h3 class="record__annotations__label">
{% if annotationTypes[item.key].displayName %}{{ annotationTypes[item.key].displayName }}{% else %}{{ item.name }}{% endif %}{% if item.structuredValue %}:{% endif %}
</h3>
{% if item.structuredValue %}
{{ partials.structuredValue(item.structuredValue) }}
{% endif %}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
</div>
<div class="section__sidecode">
<pre class="container container--inner code-example"><code class="hljs bash">{{ partials.curlSecurityScheme(secScheme, baseUri) | trim }}</code></pre>
</div>
</div>
</div>
<!-- Responses -->
{% if secScheme.describedBy.responses and secScheme.describedBy.responses.length > 0 %}
{% for response in secScheme.describedBy.responses %}
<div class="section-group section-group--separated record__response collapsible--collapsed" id="{{ secSchemeAnchor }}:response-{{ response.code }}">
<div class="section section-group__header">
<div class="section__content container--inner">
<h3 class="content-group__title content-group__title--sticky collapsible__toggler collapsible__head" data-target="{{ secSchemeAnchor }}:response-{{ response.code }}">
<span class="content-group__title__label">{{ helpers.httpCodeLabel(response.code) | trim }}</span>
{{ partials.collapsibleArrows() }}
</h3>
<div class="content-group__description rtc rtc--final content-group__description--last collapsible__el">
{% markdown %}
{{ response.description }}
{% endmarkdown %}
</div>
<div class="collapsible__el">
{% if response.headers and response.headers.length %}
<h4 class="content-group__subtitle">Headers</h4>
<table class="table">
{{ partials.paramsHeader() }}
{{ partials.paramsBody(response.headers) }}
</table>
{% endif %}
</div>
</div>
<div class="section__sidecode"></div>
</div>
{% if response.body and response.body.length > 0 %}
<div class="section-group__content collapsible__el">
{% for contentType in response.body %}
{{ partials.typeSection(contentType, resourceAnchor, "Response Body", types) }}
{% endfor %}
</div>
{% endif %}
</div>
{% endfor %}
{% endif %}
</section>
</article>