Skip to content

Commit

Permalink
Add omitempty tag to optional fields in Image
Browse files Browse the repository at this point in the history
Add omitempty tag to optional fields in Image structure. Marshaling
empty fields causes image creation to fail.
  • Loading branch information
ChrisAubuchon committed Apr 7, 2016
1 parent 6164bb9 commit 8053c4d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cloudapi/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ type MantaLocation struct {
// CreateImageFromMachineOpts represent the option that can be specified
// when creating a new image from an existing machine.
type CreateImageFromMachineOpts struct {
Machine string `json:"machine"` // The machine UUID from which the image is to be created
Name string `json:"name"` // Image name
Version string `json:"version"` // Image version
Description string `json:"description"` // Image description
Homepage string `json:"homepage"` // URL for a web page including detailed information for this image
EULA string `json:"eula"` // URL of the End User License Agreement (EULA) for the image
ACL []string `json:"acl"` // An array of account UUIDs given access to a private image. The field is only relevant to private images
Tags map[string]string `json:"tags"` // A map of key/value pairs that allows clients to categorize images by any given criteria
Machine string `json:"machine"` // The machine UUID from which the image is to be created
Name string `json:"name"` // Image name
Version string `json:"version"` // Image version
Description string `json:"description,omitempty"` // Image description
Homepage string `json:"homepage,omitempty"` // URL for a web page including detailed information for this image
EULA string `json:"eula,omitempty"` // URL of the End User License Agreement (EULA) for the image
ACL []string `json:"acl,omitempty"` // An array of account UUIDs given access to a private image. The field is only relevant to private images
Tags map[string]string `json:"tags,omitempty"` // A map of key/value pairs that allows clients to categorize images by any given criteria
}

// ListImages provides a list of images available in the datacenter.
Expand Down

0 comments on commit 8053c4d

Please sign in to comment.