diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin-serialization/runtime/src/main/kotlin/io/quarkus/kotlin/serialization/KotlinSerializationMessageBodyWriter.kt b/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin-serialization/runtime/src/main/kotlin/io/quarkus/kotlin/serialization/KotlinSerializationMessageBodyWriter.kt index 134e5592e7ad6a..866c528c7a4e3e 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin-serialization/runtime/src/main/kotlin/io/quarkus/kotlin/serialization/KotlinSerializationMessageBodyWriter.kt +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin-serialization/runtime/src/main/kotlin/io/quarkus/kotlin/serialization/KotlinSerializationMessageBodyWriter.kt @@ -30,7 +30,7 @@ class KotlinSerializationMessageBodyWriter(private val json: Json) : AllWriteabl if (o is String) { // YUK: done in order to avoid adding extra quotes... entityStream.write(o.toByteArray(StandardCharsets.UTF_8)) } else { - json.encodeToStream(serializer(o.javaClass), o, entityStream) + json.encodeToStream(serializer(genericType), o, entityStream) } } diff --git a/integration-tests/resteasy-reactive-kotlin/standard/src/main/kotlin/io/quarkus/it/resteasy/reactive/kotlin/Filters.kt b/integration-tests/resteasy-reactive-kotlin/standard/src/main/kotlin/io/quarkus/it/resteasy/reactive/kotlin/Filters.kt index 436cf2fb4a240f..1a20619ff2f158 100644 --- a/integration-tests/resteasy-reactive-kotlin/standard/src/main/kotlin/io/quarkus/it/resteasy/reactive/kotlin/Filters.kt +++ b/integration-tests/resteasy-reactive-kotlin/standard/src/main/kotlin/io/quarkus/it/resteasy/reactive/kotlin/Filters.kt @@ -7,6 +7,7 @@ import org.jboss.resteasy.reactive.server.SimpleResourceInfo import java.security.SecureRandom import javax.ws.rs.container.ContainerRequestContext import javax.ws.rs.container.ContainerResponseContext +import javax.ws.rs.container.ResourceInfo import javax.ws.rs.core.Response import javax.ws.rs.core.UriInfo @@ -33,9 +34,10 @@ class Filters { } @ServerResponseFilter - suspend fun addResponseHeader(context: ContainerResponseContext, simpleResourceInfo: SimpleResourceInfo) { + suspend fun addResponseHeader(context: ContainerResponseContext, simpleResourceInfo: SimpleResourceInfo, resourceInfo: ResourceInfo) { delay(100) context.headers.add("method", simpleResourceInfo.methodName) + context.headers.add("method2", resourceInfo.resourceMethod.name) delay(100) } }