You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Quarkus project using Resteasy reactive + Jackson with a generated REST API interface. That includes query parameters of type Map<String, Object> which are sent as JSON by the client.
The Quarkus build fails with the following exception:
java.lang.RuntimeException: Invalid parameter type 'java.util.Map<java.lang.String, java.lang.Object>' used on method method io.smallrye.mutiny.Uni<org.acme.Pojo> testEndpoint(java.util.Map<java.lang.String, java.lang.Object> projection) on class org.acme.MyApi
In general the Java type of the method parameter may:
Be a primitive type;
Have a constructor that accepts a single String argument;
Have a static method named valueOf or fromString that accepts a single String argument (see, for example, Integer.valueOf(String) and java.util.UUID.fromString(String));
Have a registered implementation of jakarta.ws.rs.ext.ParamConverterProvider JAX-RS extension SPI that returns a jakarta.ws.rs.ext.ParamConverter instance capable of a "from string" conversion for the type. or
Be List<T>, Set<T> or SortedSet<T>, where T satisfies 2 or 3 above. The resulting collection is read-only.
This is the case, as I provide a ParamConverter + ParamConverterProvider.
Hint: It seems the corresponding class is only able to parse a handful of parameterized types (like list and (sorted) set), but not maps or other types, it does not even look up existing ParamConverters.
Interestingly, the non-reactive version of RestEasy is able to handle this properly - there is another branch in the reproducer project called non-reactive, which builds fine.
pravussum
changed the title
[RestEays Reactive] ParamConverter for query params not used
[RestEasy Reactive] ParamConverter for query params not used
Feb 7, 2022
geoand
changed the title
[RestEasy Reactive] ParamConverter for query params not used
ParamConverter for query params not used in RestEasy Reactive
Feb 8, 2022
Describe the bug
I have a Quarkus project using Resteasy reactive + Jackson with a generated REST API interface. That includes query parameters of type
Map<String, Object>
which are sent as JSON by the client.The Quarkus build fails with the following exception:
According to the JAX-RS resources documentation a valid method parameter has to fulfill one of the following:
This is the case, as I provide a ParamConverter + ParamConverterProvider.
Hint: It seems the corresponding class is only able to parse a handful of parameterized types (like list and (sorted) set), but not maps or other types, it does not even look up existing ParamConverters.
I created a reproducer which fails when being built: https://github.com/pravussum/quarkus-query-param-repro
Interestingly, the non-reactive version of RestEasy is able to handle this properly - there is another branch in the reproducer project called non-reactive, which builds fine.
Expected behavior
In the reproducer at https://github.com/pravussum/quarkus-query-param-repro there is a branch called non-reactive, which works.
The reactive version (main branch) should behave the same.
Actual behavior
The build of the reactive version (main branch) fails with the above error.
How to Reproduce?
Here is a reproducer: https://github.com/pravussum/quarkus-query-param-repro
Just clone & run
mvn install
to see the build fail.Output of
uname -a
orver
5.13.0-27-generic #29-Ubuntu SMP Wed Jan 12 17:36:47 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
openjdk-15.0.2
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.7.0
Build tool (ie. output of
mvnw --version
orgradlew --version
)Maven 3.8.4
Additional information
No response
The text was updated successfully, but these errors were encountered: