Skip to content

Commit ae06598

Browse files
committed
Fix: x-apidocgen
1 parent 97cd7ac commit ae06598

File tree

7 files changed

+17
-52
lines changed

7 files changed

+17
-52
lines changed

coderd/apidoc/docs.go

+1
Original file line numberDiff line numberDiff line change
@@ -2796,6 +2796,7 @@ const docTemplate = `{
27962796
}
27972797
},
27982798
"codersdk.PostWorkspaceAgentVersionRequest": {
2799+
"description": "x-apidocgen:skip",
27992800
"type": "object",
28002801
"properties": {
28012802
"version": {

coderd/apidoc/swagger.json

+1
Original file line numberDiff line numberDiff line change
@@ -2516,6 +2516,7 @@
25162516
}
25172517
},
25182518
"codersdk.PostWorkspaceAgentVersionRequest": {
2519+
"description": "x-apidocgen:skip",
25192520
"type": "object",
25202521
"properties": {
25212522
"version": {

codersdk/workspaceagents.go

+1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ type WorkspaceAgentConnectionInfo struct {
115115
}
116116

117117
// @typescript-ignore PostWorkspaceAgentVersionRequest
118+
// @Description x-apidocgen:skip
118119
type PostWorkspaceAgentVersionRequest struct {
119120
Version string `json:"version"`
120121
}

docs/api/agents.md

-35
Original file line numberDiff line numberDiff line change
@@ -437,38 +437,3 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/me/report-stats \
437437
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.AgentStatsResponse](schemas.md#codersdkagentstatsresponse) |
438438

439439
To perform this operation, you must be authenticated by means of one of the following methods: **CoderSessionToken**.
440-
441-
## Submit workspace agent version
442-
443-
### Code samples
444-
445-
```shell
446-
# Example request using curl
447-
curl -X POST http://coder-server:8080/api/v2/workspaceagents/me/version \
448-
-H 'Content-Type: application/json' \
449-
-H 'Coder-Session-Token: API_KEY'
450-
```
451-
452-
`POST /workspaceagents/me/version`
453-
454-
> Body parameter
455-
456-
```json
457-
{
458-
"version": "string"
459-
}
460-
```
461-
462-
### Parameters
463-
464-
| Name | In | Type | Required | Description |
465-
| ------ | ---- | ------------------------------------------------------------------------------------------------ | -------- | --------------- |
466-
| `body` | body | [codersdk.PostWorkspaceAgentVersionRequest](schemas.md#codersdkpostworkspaceagentversionrequest) | true | Version request |
467-
468-
### Responses
469-
470-
| Status | Meaning | Description | Schema |
471-
| ------ | ------------------------------------------------------- | ----------- | ------ |
472-
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | |
473-
474-
To perform this operation, you must be authenticated by means of one of the following methods: **CoderSessionToken**.

docs/api/schemas.md

-14
Original file line numberDiff line numberDiff line change
@@ -2276,20 +2276,6 @@ Parameter represents a set value for the scope.
22762276
| `source_scheme` | `none` |
22772277
| `source_scheme` | `data` |
22782278

2279-
## codersdk.PostWorkspaceAgentVersionRequest
2280-
2281-
```json
2282-
{
2283-
"version": "string"
2284-
}
2285-
```
2286-
2287-
### Properties
2288-
2289-
| Name | Type | Required | Restrictions | Description |
2290-
| --------- | ------ | -------- | ------------ | ----------- |
2291-
| `version` | string | false | | |
2292-
22932279
## codersdk.PostWorkspaceAppHealthsRequest
22942280

22952281
```json

scripts/apidocgen/markdown-template/main.dot

+8-3
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,14 @@
9292

9393
> This page is incomplete, stay tuned.
9494

95-
{{ for (var s in data.components.schemas) { }}
96-
{{ var origSchema = data.components.schemas[s]; }}
97-
{{ var schema = data.api.components.schemas[s]; }}
95+
{{ for (var s in data.components.schemas) {
96+
var origSchema = data.components.schemas[s];
97+
var schema = data.api.components.schemas[s];
98+
99+
if (schema.description && schema.description.startsWith("x-apidocgen:skip")) {
100+
continue;
101+
}
102+
}}
98103

99104
{{= data.tags.section }}
100105
## {{=s}}

scripts/apidocgen/markdown-template/operation.dot

+6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818

1919
## {{= data.operationUniqueName}}
2020

21+
{{
22+
if (data.operation['x-apidocgen'] && data.operation['x-apidocgen'].skip) {
23+
return "";
24+
}
25+
}}
26+
2127
{{ data.methodUpper = data.method.verb.toUpperCase(); }}
2228
{{ data.url = data.utils.slashes(data.baseUrl + data.method.path); }}
2329
{{ data.parameters = data.operation.parameters; }}

0 commit comments

Comments
 (0)