mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: Validate template version name (#6804)
* WIP * Update * Validation
This commit is contained in:
@@ -42,7 +42,7 @@ type OrganizationMember struct {
|
||||
|
||||
// CreateTemplateVersionRequest enables callers to create a new Template Version.
|
||||
type CreateTemplateVersionRequest struct {
|
||||
Name string `json:"name,omitempty" validate:"omitempty,template_name"`
|
||||
Name string `json:"name,omitempty" validate:"omitempty,template_version_name"`
|
||||
// TemplateID optionally associates a version with a template.
|
||||
TemplateID uuid.UUID `json:"template_id,omitempty" format:"uuid"`
|
||||
StorageMethod ProvisionerStorageMethod `json:"storage_method" validate:"oneof=file,required" enums:"file"`
|
||||
|
||||
@@ -77,7 +77,7 @@ type TemplateVersionVariable struct {
|
||||
}
|
||||
|
||||
type PatchTemplateVersionRequest struct {
|
||||
Name string `json:"name"`
|
||||
Name string `json:"name" validate:"omitempty,template_version_name"`
|
||||
}
|
||||
|
||||
// TemplateVersion returns a template version by ID.
|
||||
|
||||
Reference in New Issue
Block a user