Skip to content

Commit

Permalink
Use proper type for serializing Kotlin response
Browse files Browse the repository at this point in the history
Fixes: #28096
  • Loading branch information
geoand committed Oct 6, 2022
1 parent f9dd29f commit c1b258c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -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)
}
}

Expand Down
Expand Up @@ -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

Expand All @@ -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)
}
}

0 comments on commit c1b258c

Please sign in to comment.