Skip to content

Request: Support subclasses for @ExposesResourceFor #2159

Open
@chrylis

Description

@chrylis

With Spring HATEOAS 1.5.6, I am writing a REST controller (/activity) that can return multiple subtypes of ActivityDto (ActivityMentionDto, ActivityReplyDto, etc.). I want to be able to annotate the controller with @ExposesResourceFor(ActivityDto.class) and use EntityLinks to generate self links for the concrete classes. However, this produces this error at runtime:

Cannot determine link for com.example/ActivityMentionDto! No EntityLinks instance found supporting the domain type!

As @ExposesResourceFor takes only a single Class parameter and is not repeatable, I would like @ExposesResourceFor to support subclasses of the declared type in the absence of a more specific declaration.

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