-
Notifications
You must be signed in to change notification settings - Fork 470
Generics bounds too strict in RepresentationModelAssemblerSupport #1122
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
Comments
This is glitch in our generics declarations. Will be fixed ASAP. |
…port. We constrained the RepresentationModel type parameter in a way that non of the RepresentationModel subclasses we provide aren't usable with it. That's now fixed by loosing that restriction to an arbitrary type.
Thanks a lot for the quick fix! |
I have tested with the snapshot build and this is fixed. Thanks! |
Please, I'm having the same issue with spring boot 2.2.2 and spring Hateoas v1. What is the version of Spring Hateoas with this issue solved? |
@margfernan If you use Spring Boot 2.3.0.BUILD-SNAPSHOT with I'm a little vague on whether or not |
@odrotbohm and @gregturn thank you for your response but I tried with the version 1.1.0.BUILD-SNAPSHOT but the error still appears. Even, if I extend the assembler class to RepresentationModelAssemblerSupport, it happen the same issue. Please, I need a urgent solution. |
As indicated by the error message you need to properly type The 1.1.0.BUILD-SNAPSHOTs should actually work with current Boot 2.2 as well. We could issue a first milestone of the former pretty soon if that helps. I'm afraid a GA release of Spring HATEOAS 1.1 is still a bit far out. |
When I'm not mistaken, this is a compile-time fix that has no side-effects. Is it possible to backport this to 1.0.x and release it earlier? |
It changes API, which is why I was hesitant to back port it. On the other hand, IIUC it's completely unusable in the 1.0.x branch anyway, which means that there's nothing in there we can break even more than it already is broken, right? |
Indeed, that's how I see it. |
Looks like we've already done this with #1126. |
#1126 was included in 1.0.2. I've tested this on 1.0.2 and can confirm it is fixed. |
It works! Thanks a lot!! |
With Spring Hateoas 0.25, we had code like this:
Now I'm migrating it to 1.0, like this:
This however doesn't compile:
Any idea what's going wrong here?
P.S. I asked this on StackOverflow first and got the suggestion to use
SimpleRepresentationModelAssembler
, but that only works for this simple case. We have more complex cases too.The text was updated successfully, but these errors were encountered: