Question: I'm trying to initialize Ktor http client and setup json serialization. I need to allow non-strict deserialization which **JSON.nonstrict** object allows. Just can't get how to apply this setting to serializer.

```
 val client = HttpClient {
                install(JsonFeature) {
                    serializer = KotlinxSerializer()                    
                }
        }

```

Answer: 
You can specify json configurations using the Json builder, which you pass into the KotlinxSerializer.

```
val client = HttpClient {
    install(JsonFeature) {
        serializer = KotlinxSerializer(Json {
            isLenient = true
            ignoreUnknownKeys = true
        })                    
    }
}

```

The exact fields for the Json builder is experimental and subject to change, so check out the [source code here.](https://github.com/ktorio/ktor/blob/master/ktor-features/ktor-serialization/jvm/src/io/ktor/serialization/JsonSupport.kt#L48)
This is how you can configure the JsonConfig for the Spring reactive Webclient:

```

val json = Json { ignoreUnknownKeys = true isLenient = true }

val strategies = ExchangeStrategies
    .builder()
    .codecs { clientDefaultCodecsConfigurer ->
        run {
            clientDefaultCodecsConfigurer.defaultCodecs()
                .kotlinSerializationJsonDecoder(KotlinSerializationJsonDecoder(json))
            clientDefaultCodecsConfigurer.defaultCodecs()
                .kotlinSerializationJsonEncoder(KotlinSerializationJsonEncoder(json))

        }
    }.build()

return WebClient
    .builder()
    .exchangeStrategies(strategies)
    .baseUrl(baseUrl!!)
    .build()

```