mirror of
https://github.com/longbridge/developers.git
synced 2026-09-19 03:34:09 +08:00
101 lines
2.4 KiB
Modula-2
101 lines
2.4 KiB
Modula-2
{{ data.responses = data.utils.getResponses(data); }}
|
|
{{ data.responseSchemas = false; }}
|
|
{{~ data.responses :response }}
|
|
{{ if (response.content) data.responseSchemas = true; }}
|
|
{{~}}
|
|
|
|
{{? data.responseSchemas }}
|
|
{{?}}
|
|
|
|
{{= data.tags.section }}
|
|
### Response
|
|
|
|
#### Response Headers
|
|
|
|
- Content-Type: application/json
|
|
|
|
{{? data.operation.request_body }}
|
|
#### Response Example
|
|
|
|
```json
|
|
{{= JSON.stringify(data.operation.response_body || {}, null, 2) }}
|
|
```
|
|
{{?}}
|
|
|
|
#### Response Status
|
|
|
|
| Status | Description | Schema |
|
|
|---|---|---|
|
|
{{~ data.responses :r}}| {{=r.status}} | {{=r.description || 'none'}} | {{=r.schema}} |
|
|
{{~}}
|
|
|
|
{{ data.responseSchemas = false; }}
|
|
{{~ data.responses :response }}
|
|
{{ if (response.content && !response.$ref && !data.utils.isPrimitive(response.type)) data.responseSchemas = true; }}
|
|
{{~}}
|
|
{{? data.responseSchemas }}
|
|
|
|
#### Response Schema
|
|
|
|
{{~ data.responses :response}}
|
|
{{? response.content && !response.$ref && !data.utils.isPrimitive(response.type)}}
|
|
{{? Object.keys(response.content).length }}
|
|
{{ var responseKey = Object.keys(response.content)[0]; }}
|
|
{{ var responseSchema = response.content[responseKey].schema; }}
|
|
{{ var enums = []; }}
|
|
{{ var blocks = data.utils.schemaToArray(responseSchema,0,{trim:true,join:true},data); }}
|
|
{{ for (var block of blocks) {
|
|
for (var p of block.rows) {
|
|
if (p.schema && p.schema.enum) {
|
|
for (var e of p.schema.enum) {
|
|
enums.push({name:p.name,value:e});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}}
|
|
|
|
{{? blocks[0].rows.length || blocks[0].title }}
|
|
Status Code **{{=response.status}}**
|
|
|
|
{{~ blocks :block}}
|
|
{{? block.title }}*{{=block.title}}*
|
|
{{?}}
|
|
| Name | Type | Required | Description |
|
|
|---|---|---|---|---|
|
|
{{~block.rows :p}}| {{=p.displayName}} | {{=p.safeType}} | {{=p.required}} | {{=p.description||'none'}} |
|
|
{{~}}
|
|
{{~}}
|
|
{{?}}
|
|
|
|
{{? enums.length > 0 }}
|
|
#### Enumerated Values
|
|
|
|
| Property | Value |
|
|
|---|---|
|
|
{{~ enums :e}}| {{=e.name}} | {{=data.utils.toPrimitive(e.value)}} |
|
|
{{~}}
|
|
|
|
{{?}}
|
|
{{?}}
|
|
|
|
{{ data.response = response; }}
|
|
{{#def.links}}
|
|
|
|
{{?}}
|
|
{{~}}
|
|
{{?}}
|
|
|
|
{{ data.responseHeaders = data.utils.getResponseHeaders(data); }}
|
|
{{? data.responseHeaders.length }}
|
|
|
|
#### Response Headers
|
|
|
|
| Status | Header | Type | Format | Description |
|
|
|---|---|---|---|---|
|
|
{{~ data.responseHeaders :h}}| {{=h.status}} | {{=h.header}} | {{=h.type}} | {{=h.format||''}} | {{=h.description||'none'}} |
|
|
{{~}}
|
|
|
|
{{?}}
|
|
{{= data.tags.endSection }}
|