diff --git a/cmd/generator/cloudspec/spec_modifier.go b/cmd/generator/cloudspec/spec_modifier.go index 029450f2..5e628ff4 100644 --- a/cmd/generator/cloudspec/spec_modifier.go +++ b/cmd/generator/cloudspec/spec_modifier.go @@ -100,6 +100,15 @@ func Modify(cloudSpec *spec.Swagger) { cloudSpec.Definitions[k].Properties[kk] = prop } + addExtension := func(model string, field string, key string, value interface{}) { + if k == model && kk == field { + prop.AddExtension(key, value) + cloudSpec.Definitions[k].Properties[kk] = prop + } + } + addExtension("DeploymentCreateRequest", "alias", nullableKey, true) + addExtension("DeploymentUpdateRequest", "alias", nullableKey, true) + if k == "ElasticsearchConfiguration" { if kk == "enabled_built_in_plugins" || kk == "user_bundles" || diff --git a/pkg/models/deployment_create_request.go b/pkg/models/deployment_create_request.go index 5b64342b..c3b83382 100644 --- a/pkg/models/deployment_create_request.go +++ b/pkg/models/deployment_create_request.go @@ -36,7 +36,7 @@ import ( type DeploymentCreateRequest struct { // A user-defined alias to use in place of Cluster IDs for user-friendly URLs - Alias string `json:"alias,omitempty"` + Alias *string `json:"alias,omitempty"` // Additional information about this deployment Metadata *DeploymentCreateMetadata `json:"metadata,omitempty"` diff --git a/pkg/models/deployment_update_request.go b/pkg/models/deployment_update_request.go index 3637e008..828fea02 100644 --- a/pkg/models/deployment_update_request.go +++ b/pkg/models/deployment_update_request.go @@ -37,7 +37,7 @@ import ( type DeploymentUpdateRequest struct { // A user-defined alias to use in place of Cluster IDs for user-friendly URLs - Alias string `json:"alias,omitempty"` + Alias *string `json:"alias,omitempty"` // Any new information about the current deployment object. If there is no new information the value is unchanged. Metadata *DeploymentUpdateMetadata `json:"metadata,omitempty"`