spring-projects / spring-projects/spring-hateoas
@Links/@Link annotations
Open
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 476
- PR merge metrics
- No merged PRs in 30d
Description
As a Developer I want to use annotation to describe additional Resource links :
@Links(
@Link(ref="self", href="/{id}"), //can be optional optional or auto detected
@Link(ref="comments", href="/{id}/comments"), //ID can be optional or auto detected
@Link(ref="worklogs", href="/{id}/worklogs") //ID can be optional or auto detected
)
public class IssueResource {
...
@RequestMapping(path = "/api/issues")
@ExposesResourceFor(IssueResource.class)
public class IssueResourceController {
...
and get as result JSON with :
"_links" : [
"self" : {
"href" : "http://host:port/api/issues/TEST-1"
},
"comments" : {
"href" : "http://host:port/api/issues/TEST-1/comments"
},
"worklogs" : {
"href" : "http://host:port/api/issues/TEST-1/worklogs"
}
]
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are identified. Start by reviewing the @Links/@Link and @ExposesResourceFor examples in the issue, then inspect how Spring HATEOAS currently renders resource links; done means annotated resources produce the requested self, comments, and worklogs links with the expected URLs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100