We break down the contract of the
GET /api/v1/tasks list endpoint: why it is better to wrap the response in an object
{
"tasks"
:
[...]
}, how to read
query parameters correctly through
url.Values, validate
done/
sort, filter without extra allocations, and make the output deterministic: sort by
ID by default, and by
Title with a tie-break by
ID when
sort=title. In the end, we assemble a handler pipeline
parse → list → filter → sort → encode on
net/http.