Skip to content

Commit

Permalink
Add omitempty tags to non-required struct fields
Browse files Browse the repository at this point in the history
  • Loading branch information
CondensedTea committed Feb 19, 2022
1 parent aa37f2b commit 31b7505
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,24 +317,24 @@ type TransitionField struct {

// CreateTransitionPayload is used for creating new issue transitions
type CreateTransitionPayload struct {
Update TransitionPayloadUpdate `json:"update" structs:"update"`
Update TransitionPayloadUpdate `json:"update,omitempty" structs:"update,omitempty"`
Transition TransitionPayload `json:"transition" structs:"transition"`
Fields TransitionPayloadFields `json:"fields" structs:"fields"`
}

// TransitionPayloadUpdate represents the updates of Transition calls like DoTransition
type TransitionPayloadUpdate struct {
Comment []TransitionPayloadComment `json:"comment" structs:"comment"`
Comment []TransitionPayloadComment `json:"comment,omitempty" structs:"comment,omitempty"`
}

// TransitionPayloadComment represents comment in Transition payload
type TransitionPayloadComment struct {
Add TransitionPayloadCommentBody `json:"add" structs:"add"`
Add TransitionPayloadCommentBody `json:"add,omitempty" structs:"add,omitempty"`
}

// TransitionPayloadCommentBody represents body of comment in payload
type TransitionPayloadCommentBody struct {
Body string `json:"body"`
Body string `json:"body,omitempty"`
}

// TransitionPayload represents the request payload of Transition calls like DoTransition
Expand Down

0 comments on commit 31b7505

Please sign in to comment.