Change Mono#then to Mono#flatMap in documentation

Issue: SPR-15318
This commit is contained in:
Sebastien Deleuze
2017-04-13 15:31:44 +02:00
parent e3fae2716e
commit dce72e0ad0
2 changed files with 2 additions and 2 deletions

View File

@@ -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);
}
}

View File

@@ -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));
----