-
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
Problem
No hypermedia links in responses:
- Clients must hardcode URLs
- API not self-documenting
- Navigation requires out-of-band knowledge
Proposed Solution
Link Headers and Body Links
type TaskResponse struct {
Task
Links map[string]Link `json:"_links"`
}
type Link struct {
Href string `json:"href"`
Method string `json:"method,omitempty"`
Title string `json:"title,omitempty"`
}
// Example response
{
"id": "task-123",
"title": "Implement feature",
"status": "pending",
"_links": {
"self": {"href": "/v1/tasks/task-123"},
"claim": {"href": "/v1/tasks/task-123/claim", "method": "POST"},
"runs": {"href": "/v1/tasks/task-123/runs"},
"parent": {"href": "/v1/tasks"}
}
}Acceptance Criteria
-
_linksobject in all responses -
selflink always present - Related resource links
- Action links with methods
- Link header for pagination
References
- Parent Epic: 🔌 Epic: API Improvements #72