Skip to content

Commit

Permalink
fix: content negotiation json serialization installed
Browse files Browse the repository at this point in the history
  • Loading branch information
y9san9 committed Oct 31, 2023
1 parent f934142 commit 62695b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions api/api-ktor/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies {
commonMainImplementation(libs.ktorClientWebSockets)
commonMainImplementation(libs.rsocketKtorClient)
commonMainImplementation(libs.ktorClientContentNegotiation)
commonMainImplementation(libs.ktorSerializationJson)

commonMainApi(projects.api)
commonMainImplementation(projects.types.serializable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import io.ktor.client.plugins.contentnegotiation.*
import io.ktor.client.plugins.websocket.*
import io.ktor.client.request.*
import io.ktor.http.*
import io.ktor.serialization.kotlinx.json.*
import io.ktor.utils.io.errors.*
import io.rsocket.kotlin.ktor.client.RSocketSupport
import kotlinx.coroutines.CancellationException
Expand All @@ -42,17 +43,14 @@ public class KtorMeetacyEngine(
}

private val httpClient = httpClient.config {

expectSuccess = true
install(WebSockets)
install(RSocketSupport)
install(ContentNegotiation) {
Json(json) {
ignoreUnknownKeys = true
}
json(json)
}
defaultRequest {
header(HttpHeaders.ContentType, ContentType.Application.Json.toString())
header(HttpHeaders.ContentType, ContentType.Application.Json)
}
}

Expand Down

0 comments on commit 62695b7

Please sign in to comment.