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

The @Relation annotation should be respected if evaluating the 'class' property of a Siren entity #330

Open
marcuslange opened this issue Aug 17, 2021 · 1 comment
Assignees
Labels
type:feature A new feature
Milestone

Comments

@marcuslange
Copy link

Describe the bug
@relation annotation is not reflected in response.

To Reproduce
Add @relation to a RepresentationModel and request object.

Expected behavior
@relation(itemRelation = "Person") should produce "class": ["Person"]

Environment:

  • Spring HATEOAS Siren version 1.2.0
  • Spring Boot version 2.5.2
  • Spring Framework version 5.3.8
@marcuslange marcuslange added the type:bug Something isn't working label Aug 17, 2021
@ingogriebsch
Copy link
Owner

Hey @marcuslange this is in my opinion not a bug. As the reference documentation mentions here, the library implements a really simple approach at the moment to evaluate the class property of a Siren entity (means, evaluating the @Relation annotation is not supported through the implementation).

Additionally it is not yet clear to me if the @Relation annotation should in general be used as a basis to evaluate the class property of a Siren entity.

We will think about how to support this use case. In the meantime you are able to provide a custom implementation of the SirenEntityClassProvider SPI as a @Bean to let the library pick up and use it.

It looks like Spring HATEOAS AnnotationLinkRelationProvider or Spring Core AnnotatedElementUtils are your friends if you want to implement a fast and easy first solution. :)

@ingogriebsch ingogriebsch added type:feature A new feature and removed type:bug Something isn't working labels Aug 23, 2021
@ingogriebsch ingogriebsch changed the title @Relation annotation is not reflected in response The @Relation annotation should be respected if evaluating the 'class' property of a Siren entity Aug 23, 2021
@ingogriebsch ingogriebsch added this to the 1.4.0 milestone Dec 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature A new feature
Projects
None yet
Development

No branches or pull requests

2 participants