Skip to content

Commit 1677409

Browse files
committed
Fix: examples
1 parent fcaba60 commit 1677409

File tree

6 files changed

+29
-25
lines changed

6 files changed

+29
-25
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ docs/admin/prometheus.md: scripts/metricsdocgen/main.go scripts/metricsdocgen/me
458458
cd site
459459
yarn run format:write ../docs/admin/prometheus.md
460460

461-
coderd/apidoc/swagger.json: $(shell find ./scripts/apidocgen -not \( -path './scripts/apidocgen/node_modules' -prune \) -type f) $(wildcard coderd/*.go)
461+
coderd/apidoc/swagger.json: $(shell find ./scripts/apidocgen -not \( -path './scripts/apidocgen/node_modules' -prune \) -type f) $(wildcard coderd/*.go) $(wildcard codersdk/*.go)
462462
./scripts/apidocgen/generate.sh
463463
cd site
464464
yarn run format:write ../docs/api ../docs/manifest.json ../coderd/apidoc/swagger.json

coderd/apidoc/docs.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,10 +531,12 @@ const docTemplate = `{
531531
"type": "object",
532532
"properties": {
533533
"p50": {
534-
"type": "integer"
534+
"type": "integer",
535+
"example": 123
535536
},
536537
"p95": {
537-
"type": "integer"
538+
"type": "integer",
539+
"example": 146
538540
}
539541
}
540542
},

coderd/apidoc/swagger.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,12 @@
486486
"type": "object",
487487
"properties": {
488488
"p50": {
489-
"type": "integer"
489+
"type": "integer",
490+
"example": 123
490491
},
491492
"p95": {
492-
"type": "integer"
493+
"type": "integer",
494+
"example": 146
493495
}
494496
}
495497
},

codersdk/templates.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ type Template struct {
3636
}
3737

3838
type TransitionStats struct {
39-
P50 *int64
40-
P95 *int64
39+
P50 *int64 `example:"123"`
40+
P95 *int64 `example:"146"`
4141
}
4242

4343
type TemplateBuildTimeStats map[WorkspaceTransition]TransitionStats

docs/api/schemas.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,12 @@
161161
"allow_user_cancel_workspace_jobs": true,
162162
"build_time_stats": {
163163
"property1": {
164-
"p50": 0,
165-
"p95": 0
164+
"p50": 123,
165+
"p95": 146
166166
},
167167
"property2": {
168-
"p50": 0,
169-
"p95": 0
168+
"p50": 123,
169+
"p95": 146
170170
}
171171
},
172172
"created_at": "string",
@@ -212,12 +212,12 @@
212212
```json
213213
{
214214
"property1": {
215-
"p50": 0,
216-
"p95": 0
215+
"p50": 123,
216+
"p95": 146
217217
},
218218
"property2": {
219-
"p50": 0,
220-
"p95": 0
219+
"p50": 123,
220+
"p95": 146
221221
}
222222
}
223223
```
@@ -232,8 +232,8 @@
232232

233233
```json
234234
{
235-
"p50": 0,
236-
"p95": 0
235+
"p50": 123,
236+
"p95": 146
237237
}
238238
```
239239

docs/api/templates.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization-id}/tem
5656
"allow_user_cancel_workspace_jobs": true,
5757
"build_time_stats": {
5858
"property1": {
59-
"p50": 0,
60-
"p95": 0
59+
"p50": 123,
60+
"p95": 146
6161
},
6262
"property2": {
63-
"p50": 0,
64-
"p95": 0
63+
"p50": 123,
64+
"p95": 146
6565
}
6666
},
6767
"created_at": "string",
@@ -119,12 +119,12 @@ curl -X GET http://coder-server:8080/api/v2/templates/{id} \
119119
"allow_user_cancel_workspace_jobs": true,
120120
"build_time_stats": {
121121
"property1": {
122-
"p50": 0,
123-
"p95": 0
122+
"p50": 123,
123+
"p95": 146
124124
},
125125
"property2": {
126-
"p50": 0,
127-
"p95": 0
126+
"p50": 123,
127+
"p95": 146
128128
}
129129
},
130130
"created_at": "string",

0 commit comments

Comments
 (0)