-
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
BeanParam extending another class fails in RESTClient #21759
Comments
I seem to recall having an issue before with the word |
@Sgitario would you be interested in this one? |
Sure, will have a look asap |
Thanks! |
@kjq just to clarify, in the reproducer, you have:
And:
Note that the MethodParams is missing the extends BaseParams. I've confirmed that the path |
The method `ClassInfo.annotations` only returns the annotations at the current class level. This PR makes the parser method to also find the inherited annotations. Fix quarkusio#21759
Hello Jose.
Sorry about that, I don't know how I missed that. Yes, you are correct -
that is the issue.
…On Mon, Nov 29, 2021 at 6:45 AM Jose Carvajal ***@***.***> wrote:
@kjq <https://github.com/kjq> just to clarify, in the reproducer, you
have:
public static class BaseParams
{
@PathParam("base")
private String base;
// ...
}
And:
public static class MethodParams
{
@PathParam("value")
private String value;
// ...
}
Note that the MethodParams is missing the *extends BaseParams*.
I've confirmed that the path base is still not found even adding the extends
BaseParams in your reproducer, which is the issue you reported. Can you
confirm this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#21759 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAECKMWT54M3A3HIMY5M2DTUONRT7ANCNFSM5I5NONFA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Ok, thanks for confirming. The linked pull request should address this issue. |
The method `ClassInfo.annotations` only returns the annotations at the current class level. This PR makes the parser method to also find the inherited annotations. Fix quarkusio#21759 (cherry picked from commit b44601a)
Describe the bug
When a @BeanParam is used in a RESTClient and it extends another class it fails with the path param property not found.
If the class doe not extend another class or the properties are replicated in the extended class it will work fine.
beanparam.zip
Expected behavior
Classes can extend other classes and be used as @BeanParams.
Actual behavior
When the class extends another class it fails on the parents "properties" with "property not provided"
Non REST clients work find using the BeanParam if it extends another class.
Tried:
The only thing that worked was to "replicate" the properties in each of the classes.
How to Reproduce?
Reproducer attached - running the tests demonstrate the issue.
There are two classes (
BaseParam
andMethodParams
). You will get the below exception:Prior to modifying the old reproducer (for RESTClient does not support BeanParams), and without extending another class, the test passed.
Output of
java -version
JDK 17
Quarkus version or git rev
2.5.0.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Maven 3.8.4 (with Lombok)
Additional information
I am still investigating this as well. Something is odd that I cannot pinpoint yet. I have other classes, used as @BeanParam that extend other classes, and they work as expected.
The text was updated successfully, but these errors were encountered: