Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Support subclasses for @ExposesResourceFor #2159

Open
chrylis opened this issue Jun 18, 2024 · 0 comments
Open

Request: Support subclasses for @ExposesResourceFor #2159

chrylis opened this issue Jun 18, 2024 · 0 comments

Comments

@chrylis
Copy link

chrylis commented Jun 18, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant