Philipp Mayer
10/03/2022, 12:17 PMdave
10/03/2022, 12:21 PMbuild/generated/source/kapt/main
Philipp Mayer
10/03/2022, 12:26 PMdave
10/03/2022, 12:27 PMPhilipp Mayer
10/03/2022, 12:29 PMdave
10/03/2022, 12:29 PMPhilipp Mayer
10/03/2022, 12:34 PMkotlin {
sourceSets {
main.kotlin.srcDirs += 'build/generated/ksp/main/kotlin'
test.kotlin.srcDirs += 'build/generated/ksp/test/kotlin'
}
}
dave
10/03/2022, 2:50 PMPhilipp Mayer
10/03/2022, 2:51 PMdave
10/03/2022, 3:02 PMPhilipp Mayer
10/03/2022, 3:04 PMdave
10/03/2022, 3:04 PMPhilipp Mayer
10/03/2022, 3:06 PMNo JsonAdapter for interface org.http4k.core.Body (with no annotations)
for interface org.http4k.core.Body body
for class org.http4k.core.MemoryResponse: java.lang.IllegalArgumentException
java.lang.IllegalArgumentException: No JsonAdapter for interface org.http4k.core.Body (with no annotations)
for interface org.http4k.core.Body body
for class org.http4k.core.MemoryResponse
at com.squareup.moshi.Moshi$LookupChain.exceptionWithLookupStack(Moshi.java:389)
at com.squareup.moshi.Moshi.adapter(Moshi.java:158)
at com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory.create(KotlinJsonAdapter.kt:292)
at com.squareup.moshi.Moshi.adapter(Moshi.java:146)
at com.squareup.moshi.Moshi.adapter(Moshi.java:106)
at com.squareup.moshi.Moshi.adapter(Moshi.java:80)
at org.http4k.format.ConfigurableMoshi.asFormatString(ConfigurableMoshi.kt:32)
at org.http4k.serverless.AutoMarshallingFnLoader.invoke$lambda-0(AutoMarshallingFnLoader.kt:19)
at org.http4k.serverless.AwsLambdaEventFunction.handleRequest(AwsLambdaEventFunction.kt:15)
Caused by: java.lang.IllegalArgumentException: No JsonAdapter for interface org.http4k.core.Body (with no annotations)
at com.squareup.moshi.Moshi.adapter(Moshi.java:156)
... 7 more
Just double-checked. This has nothing to do with KSP, looks like it also happened before but I never realized because the expected outcome was always there.dave
10/03/2022, 3:30 PMinternal object CommonConnectJson : ConfigurableMoshi(
Moshi.Builder()
.add(KotshiCommonConnectJsonAdapterFactory)
.asConfigurable()
.done()
)
@KotshiJsonAdapterFactory
internal interface CommonConnectJsonAdapterFactory : JsonAdapter.Factory
Philipp Mayer
10/03/2022, 3:31 PMResponse
all the way up to FnHandler
, which then automatically serialized it. Or tried to.dave
10/03/2022, 3:31 PMPhilipp Mayer
10/03/2022, 5:23 PM.asConfigurable()
is needed for my use case - I think the problem was that it tried to serialize a Response
. 🤔
But maybe I’m misinterpreting asConfigurable()
! Thanks for pointing it out anyway, just added it and will run with it.