forked from openapi-contrib/openapi3-generator
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.md.hbs
67 lines (61 loc) · 1.53 KB
/
schema.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
{{#if renderSlug}}<a id="{{schema.slug}}"></a>{{/if}}
{{#unless hideTitle}}
{{#if schema.title}}
### {{schema.title}}
{{else}}
### {{schemaName}}
{{/if}}
{{/unless}}
{{{schema.description}}}
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
{{#if schema.properties}}
{{#each schema.properties}}
{{> schemaProp prop=. propName=@key required=(isRequired ../schema @key) path='' omitReadOnly=../omitReadOnly}}
{{/each}}
{{else}}
{{> schemaProp prop=schema propName=schemaName required=(isRequired ../schema @key) path='' omitReadOnly=../omitReadOnly}}
{{/if}}
{{#if schema.additionalProperties}}
{{!--
{{#each schema.properties}}
{{> schemaProp prop=. propName=@key required=(isRequired ../schema @key) path='' omitReadOnly=../omitReadOnly}}
{{else}}
{{> schemaProp prop=schema propName=schemaName required=(isRequired ../schema @key) path='' omitReadOnly=../omitReadOnly}}
{{/each}}
{{#if schema.additionalProperties}}
--}}
<tr>
<td>*</td>
<td>
{{#if schema.additionalProperties.type}}
{{schema.additionalProperties.type}}
{{else}}<em>Any</em>{{/if}}
</td>
<td>Extension point</td>
</tr>
{{/if}}
</tbody>
</table>
{{#unless hideExamples}}
{{#if schema.example}}
#### Example
```json
{{{stringify schema.example}}}
```
{{else}}
{{#if schema.generatedExample}}
#### Example _(generated)_
```json
{{{stringify schema.generatedExample}}}
```
{{/if}}
{{/if}}
{{/unless}}