mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
docs: describe mutually exclusive create workspace template fields (#12834)
* docs: describe mutually exclusive create workspace template fields Ideally we could do this in the OpenAPI spec, but there is no first class "mutually exclusive" feature in OpenAPI. So in lieu of something more complex, or changing our struct/validation, a description comment should suffice. * chore: Add description to code sample as well
This commit is contained in:
@@ -138,6 +138,9 @@ type CreateTemplateRequest struct {
|
||||
|
||||
// CreateWorkspaceRequest provides options for creating a new workspace.
|
||||
// Either TemplateID or TemplateVersionID must be specified. They cannot both be present.
|
||||
// @Description CreateWorkspaceRequest provides options for creating a new workspace.
|
||||
// @Description Only one of TemplateID or TemplateVersionID can be specified, not both.
|
||||
// @Description If TemplateID is specified, the active version of the template will be used.
|
||||
type CreateWorkspaceRequest struct {
|
||||
// TemplateID specifies which template should be used for creating the workspace.
|
||||
TemplateID uuid.UUID `json:"template_id,omitempty" validate:"required_without=TemplateVersionID,excluded_with=TemplateVersionID" format:"uuid"`
|
||||
|
||||
Reference in New Issue
Block a user