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

Quarkus REST should check for @CustomSerialization annotations on resource methods returning Multi #40447

Open
michalvavrik opened this issue May 3, 2024 · 1 comment
Labels
area/rest kind/bug Something isn't working

Comments

@michalvavrik
Copy link
Member

michalvavrik commented May 3, 2024

Describe the bug

I mentioned that custom serialization for Multi doesn't work because serialization flow goes roughly like this:

  • org.jboss.resteasy.reactive.server.core.StreamingUtil#serialiseEntity
  • io.quarkus.resteasy.reactive.jackson.runtime.serialisers.FullyFeaturedServerJacksonMessageBodyWriter#writeTo
  • org.jboss.resteasy.reactive.server.jackson.JacksonMessageBodyWriterUtil#doLegacyWrite

Which effectively means that custom serialization is ignored because that one would require non-default writer as when io.quarkus.resteasy.reactive.jackson.runtime.serialisers.FullyFeaturedServerJacksonMessageBodyWriter#writeResponse is called.

Expected behavior

I didn't find documented that this shouldn't work for the Multi reactive type, therefore I would expect it to work.

Actual behavior

Custom serialization is not applied.

How to Reproduce?

I have tests for this: d321267 just uncomment io.quarkus.resteasy.reactive.jackson.deployment.test.ResponseType#MULTI and run mvn clean test -f extensions/resteasy-reactive/rest-jackson/deployment/ -Dtest=SecureFieldDetectionTest

Output of uname -a or ver

Fedora 38

Output of java -version

OpenJDK 21

Quarkus version or git rev

999-SNAPSHOT

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

Apache Maven 3.9.4

Additional information

No response

@geoand
Copy link
Contributor

geoand commented Jun 6, 2024

Yeah, ideally we would make it work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants