We break down the list endpoint contract for
GET /api/v1/tasks: why the response is better wrapped into an object
{
"tasks"
:
[...]
}, how to correctly read
query parameters via
url.Values, validate
done/
sort, filter without unnecessary allocations, and make the output deterministic: sorting by
ID by default, and
Title + tie-break by
ID when
sort=title. As a finale, we assemble the handler pipeline
parse → list → filter → sort → encode on
net/http.