-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathresponse.md.hbs
73 lines (67 loc) · 1.35 KB
/
response.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
{{#unless hideTitle}}
#### {{responseName}}
{{/unless}}
###### Headers
{{#each response.headers as |header headerName|}}
##### {{headerName}}
{{> schema schema=header.schema schemaName=headerName hideTitle=true hideExamples=true}}
{{#if header.schema.example}}
{{#equal contentType 'application/json'}}
```json
{{{stringify header.schema.example}}}
```
{{else}}
{{#equal contentType 'application/xml'}}
```xml
{{{header.schema.example}}}
```
{{else}}
```
{{{header.schema.example}}}
```
{{/equal}}
{{/equal}}
{{else}}
{{#if header.generatedExample}}
```json
{{{stringify header.generatedExample}}}
```
{{/if}}
{{/if}}
{{else}}
_No headers specified_
{{/each}}
{{#if response.content}}
{{#each response.content as |content contentType|}}
###### {{contentType}}
{{#if content.description}}
{{{content.description}}}
{{/if}}
{{> schema schema=content.schema schemaName='Response' hideTitle=true hideExamples=true}}
{{#if content.schema.example}}
##### Example
{{#equal contentType 'application/json'}}
```json
{{{stringify content.schema.example}}}
```
{{else}}
{{#equal contentType 'application/xml'}}
```xml
{{{content.schema.example}}}
```
{{else}}
```
{{{content.schema.example}}}
```
{{/equal}}
{{/equal}}
{{else}}
{{#if content.schema.generatedExample}}
##### Example _(generated)_
```json
{{{stringify content.schema.generatedExample}}}
```
{{/if}}
{{/if}}
{{/each}}
{{/if}}