Skip to content

ListOptions OrderBy vs. Sort confusion

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

type ListOptions struct {
	// For keyset-based paginated result sets, name of the column by which to order
	OrderBy string `url:"order_by,omitempty" json:"order_by,omitempty"`
	// For keyset-based paginated result sets, sort order (`"asc"`` or `"desc"`)
	Sort string `url:"sort,omitempty" json:"sort,omitempty"`
}

By the comments, if I want to sort by created_asc, I'm confused. Should I use created for OrderBy and asc for Sort? By try-fail-retry it's not. Just use created_asc for Sort, ignoring the comment. What the OrderBy can be is a mystery.

Edited by 🤖 GitLab Bot 🤖
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information