I am writing a simple app with Spring 5 Webflux and Kotlin. I am trying to implement PUT endpoint in a following way:
PUT(\"/confs/{id}\", {
val id = it.
I've done a very similar example here:
This router will get a geolocation from name and the with another service extract the sunrise and sunset time:
I've use the and method from Mono.
internal fun buildResponse(address: Mono) =
address.transform(geoLocationService::fromAddress).and(this::sunriseSunset, ::LocationResponse)
internal fun sunriseSunset(geographicCoordinates: GeographicCoordinates) =
geographicCoordinates.toMono().transform(sunriseSunsetService::fromGeographicCoordinates)
More details of this example