-
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
REST Client @RestForm List<T>
inside of a @BeanParam
bean does not convert
#40324
Comments
/cc @cescoffier (rest-client), @geoand (rest-client) |
Not sure if this might be tangentially related to a similar issue I'm facing. If not, I can create a separate issue.
// Doesn't work
TokenResponse getToken(@PathParam("tenant") String tenant,
@RestForm Map<String, String> form);
// Doesn't work
TokenResponse getToken(@PathParam("tenant") String tenant,
@RestForm MultivaluedMap<String, String> form);
// Works
TokenResponse getToken(@PathParam("tenant") String tenant,
@FormParam("client_id") String clientId,
@FormParam("username") String username,
@FormParam("password") String grantType,
@FormParam("client_secret") String clientSecret);
// Doesn't work
TokenResponse getToken(@PathParam("tenant") String tenant,
@FormParam("client_id") String clientId,
@FormParam("username") String username,
@FormParam("password") String grantType,
@FormParam("client_secret") String clientSecret,
@RestForm Map<String, String> filter); //empty map |
I finally got around to fixing the original issue. |
Fix List form handling in REST Client bean params
Fixes: quarkusio#40324 (cherry picked from commit 9feb173)
Fixes: quarkusio#40324 (cherry picked from commit 9feb173)
Describe the bug
Per #39996 (comment) filing another issue.
If a REST Client endpoint takes a
@BeanParam
and the bean contains a@RestForm List<T>
field, quarkus will throw a runtime exception.Expected behavior
The underlying HTTP request should be able to convert the
List
into repeated form params, e.g.param=a¶m=b¶m=c
Actual behavior
When the REST client's endpoint is invoked, a runtime exception will be thrown:
How to Reproduce?
Demo repo is here:
https://github.com/krnhotwings/quarkus-rest-client-beanparam-restform-list
Output of
uname -a
orver
6.8.7-300.fc40.x86_64
Output of
java -version
OpenJDK Runtime Environment GraalVM CE 21.0.2+13.1
Quarkus version or git rev
3.10.0.CR1
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 8.7
Additional information
No response
The text was updated successfully, but these errors were encountered: