Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 049984c

Browse files
authored
docs: Add missing body parameter (#6132)
1 parent 4493649 commit 049984c

File tree

5 files changed

+160
-4
lines changed

5 files changed

+160
-4
lines changed

coderd/apidoc/docs.go

Lines changed: 47 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 42 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/workspaces.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,12 @@ func (api *API) workspaceByOwnerAndName(rw http.ResponseWriter, r *http.Request)
271271
// @Summary Create user workspace by organization
272272
// @ID create-user-workspace-by-organization
273273
// @Security CoderSessionToken
274+
// @Accept json
274275
// @Produce json
275276
// @Tags Workspaces
276277
// @Param organization path string true "Organization ID" format(uuid)
277278
// @Param user path string true "Username, UUID, or me"
279+
// @Param request body codersdk.CreateWorkspaceRequest true "Create workspace request"
278280
// @Success 200 {object} codersdk.Workspace
279281
// @Router /organizations/{organization}/members/{user}/workspaces [post]
280282
func (api *API) postWorkspacesByOrganization(rw http.ResponseWriter, r *http.Request) {

docs/api/schemas.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,43 @@ CreateParameterRequest is a structure used to create a new parameter value for a
11471147
| `transition` | `stop` |
11481148
| `transition` | `delete` |
11491149

1150+
## codersdk.CreateWorkspaceRequest
1151+
1152+
```json
1153+
{
1154+
"autostart_schedule": "string",
1155+
"name": "string",
1156+
"parameter_values": [
1157+
{
1158+
"copy_from_parameter": "000e07d6-021d-446c-be14-48a9c20bca0b",
1159+
"destination_scheme": "none",
1160+
"name": "string",
1161+
"source_scheme": "none",
1162+
"source_value": "string"
1163+
}
1164+
],
1165+
"rich_parameter_values": [
1166+
{
1167+
"name": "string",
1168+
"value": "string"
1169+
}
1170+
],
1171+
"template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc",
1172+
"ttl_ms": 0
1173+
}
1174+
```
1175+
1176+
### Properties
1177+
1178+
| Name | Type | Required | Restrictions | Description |
1179+
| ----------------------- | ----------------------------------------------------------------------------- | -------- | ------------ | ---------------------------------------------------------------------------------------------- |
1180+
| `autostart_schedule` | string | false | | |
1181+
| `name` | string | true | | |
1182+
| `parameter_values` | array of [codersdk.CreateParameterRequest](#codersdkcreateparameterrequest) | false | | Parameter values allows for additional parameters to be provided during the initial provision. |
1183+
| `rich_parameter_values` | array of [codersdk.WorkspaceBuildParameter](#codersdkworkspacebuildparameter) | false | | |
1184+
| `template_id` | string | true | | |
1185+
| `ttl_ms` | integer | false | | |
1186+
11501187
## codersdk.DAUEntry
11511188

11521189
```json

docs/api/workspaces.md

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,46 @@
77
```shell
88
# Example request using curl
99
curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/members/{user}/workspaces \
10+
-H 'Content-Type: application/json' \
1011
-H 'Accept: application/json' \
1112
-H 'Coder-Session-Token: API_KEY'
1213
```
1314

1415
`POST /organizations/{organization}/members/{user}/workspaces`
1516

17+
> Body parameter
18+
19+
```json
20+
{
21+
"autostart_schedule": "string",
22+
"name": "string",
23+
"parameter_values": [
24+
{
25+
"copy_from_parameter": "000e07d6-021d-446c-be14-48a9c20bca0b",
26+
"destination_scheme": "none",
27+
"name": "string",
28+
"source_scheme": "none",
29+
"source_value": "string"
30+
}
31+
],
32+
"rich_parameter_values": [
33+
{
34+
"name": "string",
35+
"value": "string"
36+
}
37+
],
38+
"template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc",
39+
"ttl_ms": 0
40+
}
41+
```
42+
1643
### Parameters
1744

18-
| Name | In | Type | Required | Description |
19-
| -------------- | ---- | ------------ | -------- | --------------------- |
20-
| `organization` | path | string(uuid) | true | Organization ID |
21-
| `user` | path | string | true | Username, UUID, or me |
45+
| Name | In | Type | Required | Description |
46+
| -------------- | ---- | ---------------------------------------------------------------------------- | -------- | ------------------------ |
47+
| `organization` | path | string(uuid) | true | Organization ID |
48+
| `user` | path | string | true | Username, UUID, or me |
49+
| `body` | body | [codersdk.CreateWorkspaceRequest](schemas.md#codersdkcreateworkspacerequest) | true | Create workspace request |
2250

2351
### Example responses
2452

0 commit comments

Comments
 (0)