Skip to content

Commit 5405c0c

Browse files
committed
WIP
1 parent 0cd9c4a commit 5405c0c

File tree

5 files changed

+36
-30
lines changed

5 files changed

+36
-30
lines changed

coderd/apidoc/docs.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4192,7 +4192,8 @@ const docTemplate = `{
41924192
"type": "integer"
41934193
},
41944194
"active_version_id": {
4195-
"type": "string"
4195+
"type": "string",
4196+
"format": "uuid"
41964197
},
41974198
"allow_user_cancel_workspace_jobs": {
41984199
"type": "boolean"
@@ -4273,7 +4274,8 @@ const docTemplate = `{
42734274
"type": "string"
42744275
},
42754276
"id": {
4276-
"type": "string"
4277+
"type": "string",
4278+
"format": "uuid"
42774279
},
42784280
"markdown": {
42794281
"type": "string"
@@ -4363,7 +4365,8 @@ const docTemplate = `{
43634365
],
43644366
"properties": {
43654367
"id": {
4366-
"type": "string"
4368+
"type": "string",
4369+
"format": "uuid"
43674370
}
43684371
}
43694372
},

coderd/apidoc/swagger.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3788,7 +3788,8 @@
37883788
"type": "integer"
37893789
},
37903790
"active_version_id": {
3791-
"type": "string"
3791+
"type": "string",
3792+
"format": "uuid"
37923793
},
37933794
"allow_user_cancel_workspace_jobs": {
37943795
"type": "boolean"
@@ -3869,7 +3870,8 @@
38693870
"type": "string"
38703871
},
38713872
"id": {
3872-
"type": "string"
3873+
"type": "string",
3874+
"format": "uuid"
38733875
},
38743876
"markdown": {
38753877
"type": "string"
@@ -3957,7 +3959,8 @@
39573959
"required": ["id"],
39583960
"properties": {
39593961
"id": {
3960-
"type": "string"
3962+
"type": "string",
3963+
"format": "uuid"
39613964
}
39623965
}
39633966
},

codersdk/templates.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type Template struct {
2121
Name string `json:"name"`
2222
DisplayName string `json:"display_name"`
2323
Provisioner ProvisionerType `json:"provisioner"`
24-
ActiveVersionID uuid.UUID `json:"active_version_id"`
24+
ActiveVersionID uuid.UUID `json:"active_version_id" format:"uuid"`
2525
WorkspaceOwnerCount uint32 `json:"workspace_owner_count"`
2626
// ActiveUserCount is set to -1 when loading.
2727
ActiveUserCount int `json:"active_user_count"`
@@ -42,7 +42,7 @@ type TransitionStats struct {
4242

4343
type TemplateBuildTimeStats map[WorkspaceTransition]TransitionStats
4444
type UpdateActiveTemplateVersion struct {
45-
ID uuid.UUID `json:"id" validate:"required"`
45+
ID uuid.UUID `json:"id" validate:"required" format:"uuid"`
4646
}
4747

4848
type TemplateRole string
@@ -83,7 +83,7 @@ type UpdateTemplateMeta struct {
8383
}
8484

8585
type TemplateExample struct {
86-
ID string `json:"id"`
86+
ID string `json:"id" format:"uuid"`
8787
URL string `json:"url"`
8888
Name string `json:"name"`
8989
Description string `json:"description"`

docs/api/schemas.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2955,7 +2955,7 @@ Parameter represents a set value for the scope.
29552955
```json
29562956
{
29572957
"active_user_count": 0,
2958-
"active_version_id": "string",
2958+
"active_version_id": "eae64611-bd53-4a80-bb77-df1e432c0fbc",
29592959
"allow_user_cancel_workspace_jobs": true,
29602960
"build_time_stats": {
29612961
"property1": {
@@ -3051,7 +3051,7 @@ Parameter represents a set value for the scope.
30513051
{
30523052
"description": "string",
30533053
"icon": "string",
3054-
"id": "string",
3054+
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
30553055
"markdown": "string",
30563056
"name": "string",
30573057
"tags": ["string"],
@@ -3198,7 +3198,7 @@ Parameter represents a set value for the scope.
31983198

31993199
```json
32003200
{
3201-
"id": "string"
3201+
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
32023202
}
32033203
```
32043204

docs/api/templates.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat
2929
[
3030
{
3131
"active_user_count": 0,
32-
"active_version_id": "string",
32+
"active_version_id": "eae64611-bd53-4a80-bb77-df1e432c0fbc",
3333
"allow_user_cancel_workspace_jobs": true,
3434
"build_time_stats": {
3535
"property1": {
@@ -72,7 +72,7 @@ Status Code **200**
7272
| ------------------------------------ | --------------------------------- | -------- | ------------ | ------------------------------------------ |
7373
| `[array item]` | array | false | | |
7474
| `» active_user_count` | integer | false | | ActiveUserCount is set to -1 when loading. |
75-
| `» active_version_id` | string | false | | |
75+
| `» active_version_id` | string(uuid) | false | | |
7676
| `» allow_user_cancel_workspace_jobs` | boolean | false | | |
7777
| `» build_time_stats` | `codersdk.TemplateBuildTimeStats` | false | | |
7878
| `»» [any property]` | `codersdk.TransitionStats` | false | | |
@@ -145,7 +145,7 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/templa
145145
```json
146146
{
147147
"active_user_count": 0,
148-
"active_version_id": "string",
148+
"active_version_id": "eae64611-bd53-4a80-bb77-df1e432c0fbc",
149149
"allow_user_cancel_workspace_jobs": true,
150150
"build_time_stats": {
151151
"property1": {
@@ -209,7 +209,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat
209209
{
210210
"description": "string",
211211
"icon": "string",
212-
"id": "string",
212+
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
213213
"markdown": "string",
214214
"name": "string",
215215
"tags": ["string"],
@@ -228,16 +228,16 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat
228228

229229
Status Code **200**
230230

231-
| Name | Type | Required | Restrictions | Description |
232-
| --------------- | ------ | -------- | ------------ | ----------- |
233-
| `[array item]` | array | false | | |
234-
| `» description` | string | false | | |
235-
| `» icon` | string | false | | |
236-
| `» id` | string | false | | |
237-
| `» markdown` | string | false | | |
238-
| `» name` | string | false | | |
239-
| `» tags` | array | false | | |
240-
| `» url` | string | false | | |
231+
| Name | Type | Required | Restrictions | Description |
232+
| --------------- | ------------ | -------- | ------------ | ----------- |
233+
| `[array item]` | array | false | | |
234+
| `» description` | string | false | | |
235+
| `» icon` | string | false | | |
236+
| `» id` | string(uuid) | false | | |
237+
| `» markdown` | string | false | | |
238+
| `» name` | string | false | | |
239+
| `» tags` | array | false | | |
240+
| `» url` | string | false | | |
241241

242242
To perform this operation, you must be authenticated. [Learn more](authentication.md).
243243

@@ -268,7 +268,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat
268268
```json
269269
{
270270
"active_user_count": 0,
271-
"active_version_id": "string",
271+
"active_version_id": "eae64611-bd53-4a80-bb77-df1e432c0fbc",
272272
"allow_user_cancel_workspace_jobs": true,
273273
"build_time_stats": {
274274
"property1": {
@@ -573,7 +573,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{id} \
573573
```json
574574
{
575575
"active_user_count": 0,
576-
"active_version_id": "string",
576+
"active_version_id": "eae64611-bd53-4a80-bb77-df1e432c0fbc",
577577
"allow_user_cancel_workspace_jobs": true,
578578
"build_time_stats": {
579579
"property1": {
@@ -679,7 +679,7 @@ curl -X PATCH http://coder-server:8080/api/v2/templates/{id} \
679679
```json
680680
{
681681
"active_user_count": 0,
682-
"active_version_id": "string",
682+
"active_version_id": "eae64611-bd53-4a80-bb77-df1e432c0fbc",
683683
"allow_user_cancel_workspace_jobs": true,
684684
"build_time_stats": {
685685
"property1": {
@@ -903,7 +903,7 @@ curl -X PATCH http://coder-server:8080/api/v2/templates/{id}/versions \
903903
904904
```json
905905
{
906-
"id": "string"
906+
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
907907
}
908908
```
909909

0 commit comments

Comments
 (0)