spring-framework / org.springframework.web.reactive.function.server / bodyWithType

bodyWithType

inline fun <reified T : Any> BodyBuilder.bodyWithType(producer: Any): Mono<ServerResponse>

Extension for ServerResponse.BodyBuilder.body providing a bodyWithType<T>(Any) variant leveraging Kotlin reified type parameters. This extension is not subject to type erasure and retains actual generic type arguments.

Parameters

producer - the producer to write to the response. This must be a Publisher or another producer adaptable to a Publisher via org.springframework.core.ReactiveAdapterRegistry

Parameters

Author
Sebastien Deleuze

Since
5.2

inline fun <reified T : Any> BodyBuilder.bodyWithType(publisher: Publisher<T>): Mono<ServerResponse>

Extension for ServerResponse.BodyBuilder.body providing a bodyWithType(Publisher<T>) variant leveraging Kotlin reified type parameters. This extension is not subject to type erasure and retains actual generic type arguments.

Parameters

publisher - the Publisher to write to the response

Parameters

Author
Sebastien Deleuze

Since
5.2