-
Notifications
You must be signed in to change notification settings - Fork 27
/
operation.md.hbs
83 lines (66 loc) · 1.89 KB
/
operation.md.hbs
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
<a id="{{operation.slug}}" />
{{#if operation.summary}}
> {{{operation.summary}}}
{{/if}}
{{#if operation.description}}
{{{operation.description}}}
{{/if}}
{{#if operation.curl}}
{{> curl curl=operation.curl}}
{{/if}}
{{#if operation.pathParams}}
{{> pathParams pathParams=operation.pathParams}}
{{/if}}
{{#if operation.headers}}
{{> headers headers=operation.headers}}
{{/if}}
{{#if operation.queryParams}}
{{> queryParams queryParams=operation.queryParams}}
{{/if}}
{{#if operation.cookieParams}}
{{> cookieParams cookieParams=operation.cookieParams}}
{{/if}}
{{#if operation.requestBody}}
#### Request body
{{#each operation.requestBody.content as |contentType contentTypeName| }}
###### {{contentTypeName}}
{{> schema schema=schema schemaName='body' hideTitle=true hideExamples=true}}
{{#if examples}}
{{#each examples as |example exampleName|}}
{{> example example=example.value description=example.description externalValue=example.externalValue}}
{{/each}}
{{else}}
{{#if example}}
{{> example example=example.value description=example.description externalValue=example.externalValue}}
{{else}}
{{> example example=schema.example generatedExample=schema.generatedExample }}
{{/if}}
{{/if}}
{{/each}}
{{/if}}
{{#each operation.parameters}}
{{#equal in 'body'}}
#### Request body
{{> schema schema=../schema schemaName='body' hideTitle=true hideExamples=true}}
{{#if ../examples}}
{{#each ../examples as |example exampleName|}}
{{> example example=example.value description=example.description}}
{{/each}}
{{else}}
{{#if example}}
{{> example example=example.value description=example.description }}
{{else}}
{{> example example=schema.example generatedExample=schema.generatedExample }}
{{/if}}
{{/if}}
{{/equal}}
{{/each}}
{{#if operation.responses}}
#### Responses
{{> responses responses=operation.responses hideTitle=true}}
{{/if}}
{{#if operation.tags}}
#### Tags
{{> tags tags=operation.tags}}
{{/if}}
</div>