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