diff --git a/pkg/bundle/bundle.go b/pkg/bundle/bundle.go index 2a395285..e837fe32 100644 --- a/pkg/bundle/bundle.go +++ b/pkg/bundle/bundle.go @@ -16,11 +16,11 @@ type Bundle struct { Name string `json:"name" mapstructure:"name"` Version string `json:"version" mapstructure:"version"` Description string `json:"description" mapstructure:"description"` - Keywords []string `json:"keywords,omitempty" mapstructure:"keywords,omitempty"` - Maintainers []Maintainer `json:"maintainers,omitempty" mapstructure:"maintainers,omitempty"` + Keywords []string `json:"keywords,omitempty" mapstructure:"keywords"` + Maintainers []Maintainer `json:"maintainers,omitempty" mapstructure:"maintainers"` InvocationImages []InvocationImage `json:"invocationImages" mapstructure:"invocationImages"` Images map[string]Image `json:"images" mapstructure:"images"` - Actions map[string]Action `json:"actions,omitempty" mapstructure:"actions,omitempty"` + Actions map[string]Action `json:"actions,omitempty" mapstructure:"actions"` Parameters map[string]ParameterDefinition `json:"parameters" mapstructure:"parameters"` Credentials map[string]Location `json:"credentials" mapstructure:"credentials"` } @@ -120,7 +120,7 @@ type Action struct { // Stateless indicates that the action is purely informational, that credentials are not required, and that the runtime should not keep track of its invocation Stateless bool `json:"stateless,omitempty" mapstructure:"stateless"` // Description describes the action as a user-readable string - Description string `json:"description,omitempty" mapstructure:"description,omitempty"` + Description string `json:"description,omitempty" mapstructure:"description"` } // ValuesOrDefaults returns parameter values or the default parameter values diff --git a/pkg/bundle/parameters.go b/pkg/bundle/parameters.go index 3f0b61e1..c41a07ce 100644 --- a/pkg/bundle/parameters.go +++ b/pkg/bundle/parameters.go @@ -10,21 +10,21 @@ import ( // ParameterDefinition defines a single parameter for a CNAB bundle type ParameterDefinition struct { DataType string `json:"type" mapstructure:"type"` - DefaultValue interface{} `json:"defaultValue,omitempty" mapstructure:"defaultValue,omitempty"` - AllowedValues []interface{} `json:"allowedValues,omitempty" mapstructure:"allowedValues,omitempty"` + DefaultValue interface{} `json:"defaultValue,omitempty" mapstructure:"defaultValue"` + AllowedValues []interface{} `json:"allowedValues,omitempty" mapstructure:"allowedValues"` Required bool `json:"required" mapstructure:"required"` - MinValue *int `json:"minValue,omitempty" mapstructure:"minValue,omitempty"` - MaxValue *int `json:"maxValue,omitempty" mapstructure:"maxValue,omitempty"` - MinLength *int `json:"minLength,omitempty" mapstructure:"minLength,omitempty"` - MaxLength *int `json:"maxLength,omitempty" mapstructure:"maxLength,omitempty"` - Metadata *ParameterMetadata `json:"metadata,omitempty" mapstructure:"metadata,omitempty"` - Destination *Location `json:"destination,omitempty" mapstructure:"destination,omitempty"` + MinValue *int `json:"minValue,omitempty" mapstructure:"minValue"` + MaxValue *int `json:"maxValue,omitempty" mapstructure:"maxValue"` + MinLength *int `json:"minLength,omitempty" mapstructure:"minLength"` + MaxLength *int `json:"maxLength,omitempty" mapstructure:"maxLength"` + Metadata *ParameterMetadata `json:"metadata,omitempty" mapstructure:"metadata"` + Destination *Location `json:"destination,omitemtpty" mapstructure:"destination"` ApplyTo []string `json:"apply-to,omitempty" mapstructure:"apply-to,omitempty"` } // ParameterMetadata contains metadata for a parameter definition. type ParameterMetadata struct { - Description string `json:"description,omitempty" mapstructure:"description,omitempty"` + Description string `json:"description,omitempty" mapstructure:"description"` } // ValidateParameterValue checks whether a value is valid as the value of diff --git a/pkg/duffle/manifest/manifest.go b/pkg/duffle/manifest/manifest.go index 34605797..11b50108 100644 --- a/pkg/duffle/manifest/manifest.go +++ b/pkg/duffle/manifest/manifest.go @@ -13,14 +13,14 @@ import ( type Manifest struct { Name string `json:"name" mapstructure:"name"` Version string `json:"version" mapstructure:"version"` - Description string `json:"description,omitempty" mapstructure:"description,omitempty"` - Keywords []string `json:"keywords,omitempty" mapstructure:"keywords,omitempty"` - Maintainers []bundle.Maintainer `json:"maintainers,omitempty" mapstructure:"maintainers,omitempty"` - InvocationImages map[string]*InvocationImage `json:"invocationImages,omitempty" mapstructure:"invocationImages,omitempty"` - Images map[string]bundle.Image `json:"images,omitempty" mapstructure:"images,omitempty"` - Actions map[string]bundle.Action `json:"actions,omitempty" mapstructure:"actions,omitempty"` - Parameters map[string]bundle.ParameterDefinition `json:"parameters,omitempty" mapstructure:"parameters,omitempty"` - Credentials map[string]bundle.Location `json:"credentials,omitempty" mapstructure:"credentials,omitempty"` + Description string `json:"description,omitempty" mapstructure:"description"` + Keywords []string `json:"keywords,omitempty" mapstructure:"keywords"` + Maintainers []bundle.Maintainer `json:"maintainers,omitempty" mapstructure:"maintainers"` + InvocationImages map[string]*InvocationImage `json:"invocationImages,omitempty" mapstructure:"invocationImages"` + Images map[string]bundle.Image `json:"images,omitempty" mapstructure:"images"` + Actions map[string]bundle.Action `json:"actions,omitempty" mapstructure:"actions"` + Parameters map[string]bundle.ParameterDefinition `json:"parameters,omitempty" mapstructure:"parameters"` + Credentials map[string]bundle.Location `json:"credentials,omitempty" mapstructure:"credentials"` } // InvocationImage represents an invocation image component of a CNAB bundle