As a follow up of #21188, we should add support for kotlinx.serialization JSON to WebFlux. This will not support Flow decoding because the library does not support yet non-blocking parsing of JSON tokens like Jackson does.

Comment From: sdeleuze

https://github.com/Kotlin/kotlinx.serialization/issues/1073 should bring deserialization of big JSON arrays to Flow.

Comment From: vladimirfx

IMO non-blocking parsing is actual for streaming use cases only. But most of microservices workloads operate on memory fit (request) buffers so it can be considered as CPU only workload in parsing phase. In such case parsing can be performed as map step on fully populated buffer (ie ByteArray). Does it make sense implement this feature for non streaming use case first and then when Kotlin/kotlinx.serialization#1073 will be resolved implement full solution?

Comment From: sdeleuze

Yes we plan to do that but I think Kotlin/kotlinx.serialization#1073 is only for big arrays so no support plain stream of multiple JSON objects.

Comment From: vladimirfx

I think Roman Elizarov mentioned arrays only as obvious example of such streaming cases. So new polymorphic parser can skip unknown types as such new pull-parsing API must support skipping too. And there is another use cases such as pre-parsing filters/transformers.

Comment From: vladimirfx

Kotlin full stack projects (we have one - Kofu+KotlinJS+React) can have significant benefit from this feature. We're all waiting for!

Comment From: sdeleuze

For streaming I don't think we so at least for now, we discussed that with Roman and I think the decision was to support only arrays for now since for most use cases the framing is already handled by the underlying protocol (SSE, RSocket).