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