https://kotlinlang.org logo
#ktor
Title
# ktor
h

Hexa

11/19/2019, 6:32 PM
anyone seen this error before?
Copy code
Caused by: java.lang.IllegalArgumentException: Response pipeline couldn't transform 'class java.util.Collections$SingletonMap' to the OutgoingContent
	at io.ktor.server.engine.BaseApplicationResponse$Companion$setupSendPipeline$1.invokeSuspend(BaseApplicationResponse.kt:271)
	at io.ktor.server.engine.BaseApplicationResponse$Companion$setupSendPipeline$1.invoke(BaseApplicationResponse.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:268)
	at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(PipelineContext.kt:67)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:141)
	at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:161)
	at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:27)
n

napperley

11/19/2019, 11:47 PM
Are you doing JSON serialisation?
s

sonofblip

11/20/2019, 4:37 PM
yeah you may need to add a content negotiation strategy to your ktor application, like gson or something
Copy code
install(ContentNegotiation) {
        gson {
            setDateFormat(DateFormat.LONG)
            setPrettyPrinting()
        }
    }
2 Views