Skip to content
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

RestEasy Reactive: Custom ParamConverters not used for elements of Set in query params #27515

Closed
kdubb opened this issue Aug 25, 2022 · 3 comments · Fixed by #27529
Closed

RestEasy Reactive: Custom ParamConverters not used for elements of Set in query params #27515

kdubb opened this issue Aug 25, 2022 · 3 comments · Fixed by #27529
Assignees
Labels
area/resteasy-reactive kind/bug Something isn't working
Milestone

Comments

@kdubb
Copy link
Contributor

kdubb commented Aug 25, 2022

Describe the bug

RestEasy Reactive does not use custom ParamConverters when deserializing elements of a Set for query param

For example we have a custom converter for UUIDs, with this following JAX-RS method, the converter is never called for the elements of ids:

  @GET
  public List<Teams> fetchTeams(@QueryParam(value = "ids") Set<UUID> ) {}

Expected behavior

Properly registered ParamConverters are used when deserializing query parameters that are collection types.

FYI, RestEasy Reactive Client uses them as expected when serializing requests using the same interface/method.

Actual behavior

The "default" converter is always used. Even if a custom converter is present and properly registered.

How to Reproduce?

  1. Create a resource method similar to that shown above.
  2. Register a custom UUID handler (e.g. one that expects no dashes)
  3. Call resource method with a query parameter in the custom format.

Output of uname -a or ver

macOS 12

Output of java -version

Java 17

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.11.2.Final

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@kdubb kdubb added the kind/bug Something isn't working label Aug 25, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Aug 25, 2022

/cc @FroMage, @geoand, @stuartwdouglas

@kdubb
Copy link
Contributor Author

kdubb commented Aug 25, 2022

I attempted to investigate/fix this, but it proved beyond my RestEasy Reactive knowledge haha.

I can say the SetConverter gets initialized with a delegate/supplier of type RuntimeResolvedResolvedConverter.Supplier (seemed hopeful) but it's always a LoadedParameterConverter with a default converter for UUIDs.

@geoand
Copy link
Contributor

geoand commented Aug 26, 2022

Thanks for the report and looking into it.

#27529 fixes the issue.

geoand added a commit that referenced this issue Aug 29, 2022
Properly use ParamConverter to converting the values of collection types
@quarkus-bot quarkus-bot bot added this to the 2.13 - main milestone Aug 29, 2022
@gsmet gsmet modified the milestones: 2.13 - main, 2.12.1.Final Sep 5, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/resteasy-reactive kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants