Skip to content

Commit

Permalink
Added comment to DiffIntralineInfo from gerrit rest api docs (as sugg…
Browse files Browse the repository at this point in the history
…ested by @shurcooL).

Fixed CommentInput to have Range optional as per gerrit rest api docs. Prior that the generated json had range as empty object and that cause the gerrit return 400 Bad Request.
  • Loading branch information
egorse committed Mar 10, 2018
1 parent 3c4bc0f commit 0655566
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions changes.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,17 +240,27 @@ type DiffContent struct {

// CommentInput entity contains information for creating an inline comment.
type CommentInput struct {
ID string `json:"id,omitempty"`
Path string `json:"path,omitempty"`
Side string `json:"side,omitempty"`
Line int `json:"line,omitempty"`
Range CommentRange `json:"range,omitempty"`
InReplyTo string `json:"in_reply_to,omitempty"`
Updated string `json:"updated,omitempty"`
Message string `json:"message,omitempty"`
ID string `json:"id,omitempty"`
Path string `json:"path,omitempty"`
Side string `json:"side,omitempty"`
Line int `json:"line,omitempty"`
Range *CommentRange `json:"range,omitempty"`
InReplyTo string `json:"in_reply_to,omitempty"`
Updated string `json:"updated,omitempty"`
Message string `json:"message,omitempty"`
}

// DiffIntralineInfo entity contains information about intraline edits in a file.
//
// The information consists of a list of <skip length, mark length> pairs,
// where the skip length is the number of characters between the end of
// the previous edit and the start of this edit, and the mark length is the
// number of edited characters following the skip. The start of the edits
// is from the beginning of the related diff content lines.
//
// Note that the implied newline character at the end of each line
// is included in the length calculation, and thus it is possible for
// the edits to span newlines.
type DiffIntralineInfo [][2]int

// ChangeInfo entity contains information about a change.
Expand Down

0 comments on commit 0655566

Please sign in to comment.