Change Mono#then to Mono#flatMap in documentation
Issue: SPR-15318
This commit is contained in:
@@ -94,7 +94,7 @@ public class PersonHandler {
|
||||
Mono<ServerResponse> notFound = ServerResponse.notFound().build();
|
||||
Mono<Person> personMono = this.repository.getPerson(personId);
|
||||
return personMono
|
||||
.then(person -> ServerResponse.ok().contentType(APPLICATION_JSON).body(fromObject(person)))
|
||||
.flatMap(person -> ServerResponse.ok().contentType(APPLICATION_JSON).body(fromObject(person)))
|
||||
.switchIfEmpty(notFound);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ Mono<Account> account = client.get()
|
||||
.url("/accounts/{id}", 1L)
|
||||
.accept(APPLICATION_JSON)
|
||||
.exchange(request)
|
||||
.then(response -> response.bodyToMono(Account.class));
|
||||
.flatMap(response -> response.bodyToMono(Account.class));
|
||||
----
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user