I\'m having a controller like this one (in Kotlin):
@RestController
@RequestMapping(\"/\")
class CustomerController (private val service: CustomerService) {
Instead of throwing an exception the method's implementation can be changed to
fun findById(@PathVariable id: String,
@RequestHeader(value = IF_NONE_MATCH) versionHeader: String?): Mono> =
return service.findById(id)
.map {
// ETag stuff ...
ok().eTag("...").body(...)
}
.defaultIfEmpty(notFound().build())