spring-projects / spring-projects/spring-hateoas

Provide a way to set resource relations through annotations

Open
#401 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.1k
Forks
476
PR merge metrics
No merged PRs in 30d

Description

As raised on stack overflow, it could be very useful to provide a way to define resource relations just with annotated Pojo + regular Spring MVC controllers returning Pojo instances, without having to extend ResourceSupport or wrapping it into a Resource<Foo> container.

This is maybe already possible with the @Relation annotation, but I did not find any example or documentation about this.

If this is already possible, could you give me a quick example in order to allow me to contribute a documentation PR that will explain how to use the pure Pojo + @Relation approach?

If it is currently no possible, should it be possible to add such functionality as an alternative to Foo extends ResourceSupport and Resource<Foo> ones? Since annotations are static, I guess it will perhaps not cover all the use cases covered by the current Resource based approach, but that should be enough for a lot of use cases and I think that could awesome for our users to support this alternative way of dealing with relations.

Any thoughts?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the @Relation annotation and the existing ResourceSupport and Resource approaches described in the issue. Check whether annotated POJOs returned by regular Spring MVC controllers already support resource relations, and compare that with the linked documentation. Done means either documenting a working pure-POJO example or defining and implementing the missing alternative.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.