You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Update the mock API to alphabetize paginated list queries #2776
The API will automatically sort items by name ascending if no sort_by query param is included to override that. We should update the paginated helper in the mock API to match this behavior. [Investigate this to verify, but it's likely correct.]
Just following up with Claude's analysis of Omicron:
Default Sorting Behavior
For endpoints that support sorting by name or ID (most common case - like projects, instances, disks, etc.):
Default: name_ascending (line 427-428 in common/src/api/external/http_pagination.rs)
Items are sorted alphabetically by name in ascending order
For endpoints that only support sorting by ID:
Default: id_ascending (line 334-335)
Items are sorted by UUID in ascending order
For endpoints that sort by timestamp and ID (like audit logs):
Default: time_and_id_ascending (line 511-512)
Items are sorted by timestamp (oldest first), then by ID
How it works
The code uses Serde's #[serde(default = "...")] attribute on the sort_by field. When you don't provide a sort_by query parameter, it automatically applies the default:
fn default_nameid_sort_mode() -> NameOrIdSortMode {
NameOrIdSortMode::NameAscending // Most common default
}
So if you call GET /v1/projects without any sort_by parameter, you'll get results sorted by project name in alphabetical order (A-Z) by default.
Activity
charliepark commentedon Feb 5, 2026
Just following up with Claude's analysis of Omicron:
Default Sorting Behavior
For endpoints that support sorting by name or ID (most common case - like projects, instances, disks, etc.):
For endpoints that only support sorting by ID:
For endpoints that sort by timestamp and ID (like audit logs):
How it works
The code uses Serde's #[serde(default = "...")] attribute on the sort_by field. When you don't provide a sort_by query parameter, it automatically applies the default:
So if you call GET /v1/projects without any sort_by parameter, you'll get results sorted by project name in alphabetical order (A-Z) by default.