Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb5b5c37

Browse files
authored
docs: describe mutually exclusive create workspace template fields (#12834)
* docs: describe mutually exclusive create workspace template fieldsIdeally we could do this in the OpenAPI spec, but there is no firstclass "mutually exclusive" feature in OpenAPI. So in lieu of somethingmore complex, or changing our struct/validation, a description commentshould suffice.* chore: Add description to code sample as well
1 parent5137433 commitb5b5c37

File tree

6 files changed

+18
-0
lines changed

6 files changed

+18
-0
lines changed

‎coderd/apidoc/docs.go

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

‎coderd/apidoc/swagger.json

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

‎coderd/workspaces.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,10 @@ func (api *API) workspaceByOwnerAndName(rw http.ResponseWriter, r *http.Request)
332332
// Create a new workspace for the currently authenticated user.
333333
//
334334
// @Summary Create user workspace by organization
335+
// @Description Create a new workspace using a template. The request must
336+
// @Description specify either the Template ID or the Template Version ID,
337+
// @Description not both. If the Template ID is specified, the active version
338+
// @Description of the template will be used.
335339
// @ID create-user-workspace-by-organization
336340
// @Security CoderSessionToken
337341
// @Accept json

‎codersdk/organizations.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ type CreateTemplateRequest struct {
138138

139139
// CreateWorkspaceRequest provides options for creating a new workspace.
140140
// Either TemplateID or TemplateVersionID must be specified. They cannot both be present.
141+
// @Description CreateWorkspaceRequest provides options for creating a new workspace.
142+
// @Description Only one of TemplateID or TemplateVersionID can be specified, not both.
143+
// @Description If TemplateID is specified, the active version of the template will be used.
141144
typeCreateWorkspaceRequeststruct {
142145
// TemplateID specifies which template should be used for creating the workspace.
143146
TemplateID uuid.UUID`json:"template_id,omitempty" validate:"required_without=TemplateVersionID,excluded_with=TemplateVersionID" format:"uuid"`

‎docs/api/schemas.md

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

‎docs/api/workspaces.md

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp