~rockorager/go-jmap

1db959676c10398a8e83a52de388ea243b5b4217 — Brandon Sprague 3 months ago 6ba5e7e
Fix an issue with `isAscending`

According to the spec, it defaults to true. But since `omitempty` was set, the absence == the zero value == false, so it ends up true in the API.
3 files changed, 3 insertions(+), 3 deletions(-)

M mail/email/sort.go
M mail/emailsubmission/sort.go
M mail/mailbox/sort.go
M mail/email/sort.go => mail/email/sort.go +1 -1
@@ 9,7 9,7 @@ type SortComparator struct {

	Keyword string `json:"keyword,omitempty"`

	IsAscending bool `json:"isAscending,omitempty"`
	IsAscending bool `json:"isAscending"`

	Collation jmap.CollationAlgo `json:"collation,omitempty"`
}

M mail/emailsubmission/sort.go => mail/emailsubmission/sort.go +1 -1
@@ 5,7 5,7 @@ import "git.sr.ht/~rockorager/go-jmap"
type SortComparator struct {
	Property string `json:"property,omitempty"`

	IsAscending bool `json:"isAscending,omitempty"`
	IsAscending bool `json:"isAscending"`

	Collation jmap.CollationAlgo `json:"collation,omitempty"`
}

M mail/mailbox/sort.go => mail/mailbox/sort.go +1 -1
@@ 7,7 7,7 @@ type SortComparator struct {
	Property string `json:"property,omitempty"`

	// If true, sort in ascending order.
	IsAscending bool `json:"isAscending,omitempty"`
	IsAscending bool `json:"isAscending"`

	// The identifier, as registered in the collation registry defined in
	// RFC4790, for the algorithm to use when comparing the order of