Skip to content

Provide a way to set resource relations through annotations #401

Open
@sdeleuze

Description

@sdeleuze

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions