1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-03-21 21:07:03 +02:00

Omit more empty attributes when converting from struct to map

This commit is contained in:
Bidesh Thapaliya 2016-09-26 17:59:51 +02:00
parent 5ce765977f
commit f2937d6875

View File

@ -25,10 +25,10 @@ type ProjectList []struct {
// ProjectCategory represents a single project category // ProjectCategory represents a single project category
type ProjectCategory struct { type ProjectCategory struct {
Self string `json:"self" structs:"self"` Self string `json:"self" structs:"self,omitempty"`
ID string `json:"id" structs:"id"` ID string `json:"id" structs:"id,omitempty"`
Name string `json:"name" structs:"name"` Name string `json:"name" structs:"name,omitempty"`
Description string `json:"description" structs:"description"` Description string `json:"description" structs:"description,omitempty"`
} }
// Project represents a JIRA Project. // Project represents a JIRA Project.
@ -55,30 +55,30 @@ type Project struct {
// Version represents a single release version of a project // Version represents a single release version of a project
type Version struct { type Version struct {
Self string `json:"self" structs:"self"` Self string `json:"self" structs:"self,omitempty"`
ID string `json:"id" structs:"id"` ID string `json:"id" structs:"id,omitempty"`
Name string `json:"name" structs:"name"` Name string `json:"name" structs:"name,omitempty"`
Archived bool `json:"archived" structs:"archived"` Archived bool `json:"archived" structs:"archived,omitempty"`
Released bool `json:"released" structs:"released"` Released bool `json:"released" structs:"released,omitempty"`
ReleaseDate string `json:"releaseDate" structs:"releaseDate"` ReleaseDate string `json:"releaseDate" structs:"releaseDate,omitempty"`
UserReleaseDate string `json:"userReleaseDate" structs:"userReleaseDate"` UserReleaseDate string `json:"userReleaseDate" structs:"userReleaseDate,omitempty"`
ProjectID int `json:"projectId" structs:"projectId"` // Unlike other IDs, this is returned as a number ProjectID int `json:"projectId" structs:"projectId,omitempty"` // Unlike other IDs, this is returned as a number
} }
// ProjectComponent represents a single component of a project // ProjectComponent represents a single component of a project
type ProjectComponent struct { type ProjectComponent struct {
Self string `json:"self" structs:"self"` Self string `json:"self" structs:"self,omitempty"`
ID string `json:"id" structs:"id"` ID string `json:"id" structs:"id,omitempty"`
Name string `json:"name" structs:"name"` Name string `json:"name" structs:"name,omitempty"`
Description string `json:"description" structs:"description"` Description string `json:"description" structs:"description,omitempty"`
Lead User `json:"lead" structs:"lead"` Lead User `json:"lead,omitempty" structs:"lead,omitempty"`
AssigneeType string `json:"assigneeType" structs:"assigneeType"` AssigneeType string `json:"assigneeType" structs:"assigneeType,omitempty"`
Assignee User `json:"assignee" structs:"assignee"` Assignee User `json:"assignee" structs:"assignee,omitempty"`
RealAssigneeType string `json:"realAssigneeType" structs:"realAssigneeType"` RealAssigneeType string `json:"realAssigneeType" structs:"realAssigneeType,omitempty"`
RealAssignee User `json:"realAssignee" structs:"realAssignee"` RealAssignee User `json:"realAssignee" structs:"realAssignee,omitempty"`
IsAssigneeTypeValid bool `json:"isAssigneeTypeValid" structs:"isAssigneeTypeValid"` IsAssigneeTypeValid bool `json:"isAssigneeTypeValid" structs:"isAssigneeTypeValid,omitempty"`
Project string `json:"project" structs:"project"` Project string `json:"project" structs:"project,omitempty"`
ProjectID int `json:"projectId" structs:"projectId"` ProjectID int `json:"projectId" structs:"projectId,omitempty"`
} }
// GetList gets all projects form JIRA // GetList gets all projects form JIRA