-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
LinksProcessor ID field error for native class HalCollectionWrapper #38597
LinksProcessor ID field error for native class HalCollectionWrapper #38597
Conversation
@Sgitario this is a draft PR. Which I would like you to have a look at. There is still one issue to be solved. The Jsonb serializers don't seem to be triggered any more since the HalWrapper types got added a type argument. The Jackson serializer works correctly. I think the typed HalWrappers no longer are matched against the serializer, but why this happens I do not know. Looking at eclipse yasson it should work. Do you have any idea? Note: Builds of this PR will fail until the issue is resolved |
🙈 The PR is closed and the preview is expired. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a doubt about what is the value of changing the HalEntityWrapper and the HalCollectionWrapper classes to include the parametrized type.
If I understood the changes correctly, you're proposing to use the HalService to create the wrappers which is perfectly fine (this is a change of behaviour that would need to be noted in the migration guide though).
My doubt is why we need to include the parameterized type.
We need the parameterized type to be able to determine the wrapped type which needs to be scanned for Concerning the change in behaviour creating the wrappers, the documentation is already wrong. If you use the example it will give a compile error. The constructor used in the documented example does not exist. If you use the correct constructor it also works. In my opinion using the |
I see, thanks.
Still, this needs to be noted in the migration guide.
+1 @geoand any hints about the jsonb failures? |
I can't think of anything off hand. I would start by looking backwards to where the working Jackson ones are being called and comparing with that with the Jsonb ones to see what is different |
@geoand @Sgitario I did a backtrace and the normaly I would expect |
Have you tried without it? |
I can check if the producer is called without the dependency but I will have to remove the extra testcases as they use the wrapper classes. Will post the results of my findings here. |
f5e867d
to
d471fc3
Compare
@geoand @Sgitario I did some testing and have the idea the problem is a bug in eclipse yasson. I tried the following definitions of the serializer: 1 It looks eclipse yasson has an issue with serializers and probably deserializers when the root type is generic. Maybe it is related or the same as eclipse-ee4j/yasson#243 which is fixed, but that seemed to target annotated serializers / deserializers. These are added though configuration. I've updated the PR to use the raw typed serializers as that works. I'll report an issue with eclipse yasson and update the comment in the serializers to reference that issue. What do you think? |
Sounds good to me! Thanks for looking into it. |
d471fc3
to
784eb0d
Compare
@geoand I updated the PR to point to eclipse-ee4j/yasson#639 for as why the use of raw types in the Jsonb serializers. @Sgitario How can I add something to the migration guide? |
784eb0d
to
7f86e22
Compare
Here: https://github.com/quarkusio/quarkus/wiki/Migration-Guide-3.9 |
Many thanks for your changes here @bpasson !
|
@Sgitario I don't have permissions to edit the wiki. The following should be added to the migration documentation for 3.9. Feel free to update where needed. RESTEasy Reactive HAL wrapper changesWrapper UsageThe HAL wrappers class signatures have been updated to include the type of elements in the collection as listed below.
You should add the type argument everywhere you use the HAL wrapper classes. Wrapper CreationThe preferred way of creating the wrapper classes changed from constructor to helper methods exposed on the
Creating the wrappers using the constructors will still work for now, but this might change in the future. |
@Sgitario this probably needs to be backported to 3.7 as it is broken there atm. |
0e19b9f
to
c31c5a5
Compare
…s HalCollectionWrapper
c31c5a5
to
9855040
Compare
@Sgitario a side note here. The type validation expects to find the Can you also remove the label |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Item added into the migration guide. I've renamed a bit the title to match the section in the guide: https://github.com/quarkusio/quarkus/wiki/Migration-Guide-3.9#resteasy-reactive-adding-web-links-programmatically I've updated the labels as well. cc @geoand |
🙏🏼 |
Status for workflow
|
Status for workflow
|
Thank you for the contribution! |
Fixes #38543 - LinksProcessor ID field error for native class HalCollectionWrapper