asParsedJson
Converts a flow of JSON strings into a flow of objects of the specified type, using the provided ObjectMapper.
Return
A flow of objects of the specified type.
Example usage:
data class Person(val name: String, val age: Int)
val jsonStringFlow = flowOf("""{"name":"Alice","age":30}""", """{"name":"Bob","age":25}""")
jsonStringFlow.asParsedJson<Person>().collect { person -> println(person) }
Content copied to clipboard
Parameters
objectMapper
The ObjectMapper instance to use for converting JSON strings to objects. Defaults to defaultObjectMapper.