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

Fix Jakarta Cookie serialization in native #35592

Merged
merged 1 commit into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import jakarta.ws.rs.Priorities;
import jakarta.ws.rs.RuntimeType;
import jakarta.ws.rs.core.Cookie;
import jakarta.ws.rs.core.MediaType;

import org.jboss.jandex.AnnotationInstance;
Expand Down Expand Up @@ -205,6 +206,11 @@ private String getJacksonMessageBodyReader(boolean needsFullFeatureSet) {
: ServerJacksonMessageBodyReader.class.getName();
}

@BuildStep
void reflection(BuildProducer<ReflectiveClassBuildItem> producer) {
producer.produce(ReflectiveClassBuildItem.builder(Cookie.class).methods().build());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really expected that you have to serialize a Cookie?

Copy link
Contributor Author

@geoand geoand Aug 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no reason not to really. We don't to it ourselves, but I don't see any reason why we should make it more difficult.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I consider it an internal data structure but yeah why not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's kinda grey :)

}

@Record(ExecutionTime.STATIC_INIT)
@BuildStep
void handleJsonAnnotations(Optional<ResourceScanningResultBuildItem> resourceScanningResultBuildItem,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package io.quarkus.resteasy.reactive.jsonb.deployment;

import jakarta.ws.rs.RuntimeType;
import jakarta.ws.rs.core.Cookie;

import io.quarkus.deployment.Feature;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.resteasy.reactive.common.deployment.ServerDefaultProducesHandlerBuildItem;
import io.quarkus.resteasy.reactive.jsonb.common.deployment.ResteasyReactiveJsonbCommonProcessor;
import io.quarkus.resteasy.reactive.spi.MessageBodyReaderBuildItem;
Expand All @@ -29,4 +31,9 @@ void additionalProviders(BuildProducer<MessageBodyReaderBuildItem> additionalRea
ResteasyReactiveJsonbCommonProcessor.additionalProviders(additionalReaders, additionalWriters,
RuntimeType.SERVER);
}

@BuildStep
void reflection(BuildProducer<ReflectiveClassBuildItem> producer) {
producer.produce(ReflectiveClassBuildItem.builder(Cookie.class).methods().build());
}
}