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:
Marcin Tojek
2023-01-10 15:47:08 +01:00
committed by GitHub
parent bbe33fef41
commit a23a471034
16 changed files with 1413 additions and 553 deletions
+1 -1
View File
@@ -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" \
+9 -1
View File
@@ -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') {