mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
docs: update swaggo/swag v1.8.9 (#5590)
* docs: update swaggo/swag v1.8.9 * Fix: format * swaggo: time.Duration * swaggo: provisionertype * Fix: AuthorizationObject * Fix: enums * Fix: netip.Addr * Fix: clickable response properties
This commit is contained in:
@@ -18,7 +18,7 @@ trap cleanup EXIT
|
||||
log "Use temporary file: ${API_MD_TMP_FILE}"
|
||||
|
||||
pushd "${PROJECT_ROOT}"
|
||||
go run github.com/swaggo/swag/cmd/swag@v1.8.6 init \
|
||||
go run github.com/swaggo/swag/cmd/swag@v1.8.9 init \
|
||||
--generalInfo="coderd.go" \
|
||||
--dir="./coderd,./codersdk" \
|
||||
--output="./coderd/apidoc" \
|
||||
|
||||
@@ -133,10 +133,10 @@
|
||||
|
||||
{{? block===blocks[0] }}
|
||||
{{= data.tags.section }}
|
||||
|
||||
### Properties
|
||||
{{?}}
|
||||
|
||||
{{? block.rows.length > 0 && block.rows[0].displayName != "*anonymous*"}}
|
||||
{{? block.rows.length}}|Name|Type|Required|Restrictions|Description|
|
||||
|---|---|---|---|---|{{?}}
|
||||
{{~ block.rows :p}}|{{= renderDisplayName(p)}}|{{= renderPropertyType(p)}}|{{=p.required}}|{{=p.restrictions||''}}|{{= renderDescription(p)}}|
|
||||
@@ -145,16 +145,24 @@
|
||||
{{? (blocks[0].rows.length === 0) && (blocks.length === 1) }}
|
||||
*None*
|
||||
{{?}}
|
||||
{{?}}
|
||||
|
||||
{{? enums.length > 0 }}
|
||||
{{= data.tags.section }}
|
||||
|
||||
#### Enumerated Values
|
||||
|
||||
{{? block.rows.length > 0 && block.rows[0].displayName != "*anonymous*"}}
|
||||
|Property|Value|
|
||||
|---|---|
|
||||
{{~ enums :e}}|`{{=e.name}}`|`{{=data.utils.toPrimitive(e.value)}}`|
|
||||
{{~}}
|
||||
{{??}}
|
||||
|Value|
|
||||
|---|
|
||||
{{~ enums :e}}|`{{=data.utils.toPrimitive(e.value)}}`|
|
||||
{{~}}
|
||||
{{?}}
|
||||
|
||||
{{= data.tags.endSection }}
|
||||
{{?}}
|
||||
|
||||
@@ -35,7 +35,8 @@
|
||||
|
||||
function renderResponsePropertyType(p) {
|
||||
if (p.$ref) {
|
||||
return '`' + p.$ref + '`';
|
||||
const href = p.$ref.replace(".","").toLowerCase();
|
||||
return "[" + p.$ref + "](schemas.md#" + href + ")";
|
||||
}
|
||||
|
||||
if (p.type == 'array') {
|
||||
|
||||
Reference in New Issue
Block a user