-
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
Using a custom ParamConverter fails when not sending that parameter with the request #40287
Comments
/cc @FroMage (resteasy-reactive), @geoand (resteasy-reactive), @stuartwdouglas (resteasy-reactive) |
Thanks for reporting! As you've already done an analysis on the code, would you like to open a Pull Request with the proposed change? Thanks |
Hi! I have openned a Pull Request with the fix, and also some related tests: Since this is the first time I am contributing here, I am not sure that my tests were added correctly... |
Thanks! I will check on Monday |
- Fixes quarkusio#40287 Co-Authored-By: Michel do Couto <michel.docouto@document.one>
- Fixes quarkusio#40287 Co-Authored-By: Michel do Couto <michel.docouto@document.one>
- Fixes quarkusio#40287 Co-Authored-By: Michel do Couto <michel.docouto@document.one>
- Fixes quarkusio#40287 Co-Authored-By: Michel do Couto <michel.docouto@document.one> (cherry picked from commit 56d40f1)
- Fixes quarkusio#40287 Co-Authored-By: Michel do Couto <michel.docouto@document.one> (cherry picked from commit 56d40f1)
- Fixes quarkusio#40287 Co-Authored-By: Michel do Couto <michel.docouto@document.one>
Describe the bug
When using a custom ParamConverter, the call fails when we do not sending any value for that parameter in the request.
Expected behavior
The request would be executed
Actual behavior
A 404 error happens due to a NPE.
How to Reproduce?
Take this example code:
This is the converter:
And this is its provider:
If that is setup, then trying to call the service without providing any value to the number parameter will fail within
RuntimeResolvedConverter
it fails because parameter is null.
If I provide no conversion, then it fails only when checking the
Send empty value
, since "" cannot be converted to an OptionalThus, a simple change in
RuntimeResolvedConverter
would fix this:Output of
uname -a
orver
No response
Output of
java -version
No response
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: