Browse Source

Change Mono#then to Mono#flatMap in documentation

Issue: SPR-15318
pull/1386/merge
Sebastien Deleuze 8 years ago
parent
commit
dce72e0ad0
  1. 2
      src/docs/asciidoc/web/web-flux-functional.adoc
  2. 2
      src/docs/asciidoc/web/web-flux.adoc

2
src/docs/asciidoc/web/web-flux-functional.adoc

@ -94,7 +94,7 @@ public class PersonHandler { @@ -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);
}
}

2
src/docs/asciidoc/web/web-flux.adoc

@ -150,7 +150,7 @@ Mono<Account> account = client.get() @@ -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));
----

Loading…
Cancel
Save