diff --git a/src/docs/asciidoc/web/web-flux-functional.adoc b/src/docs/asciidoc/web/web-flux-functional.adoc index 093c0d02806..1fb7dca48d4 100644 --- a/src/docs/asciidoc/web/web-flux-functional.adoc +++ b/src/docs/asciidoc/web/web-flux-functional.adoc @@ -94,7 +94,7 @@ public class PersonHandler { Mono notFound = ServerResponse.notFound().build(); Mono 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); } } diff --git a/src/docs/asciidoc/web/web-flux.adoc b/src/docs/asciidoc/web/web-flux.adoc index f6979de255e..9c76786cf7f 100644 --- a/src/docs/asciidoc/web/web-flux.adoc +++ b/src/docs/asciidoc/web/web-flux.adoc @@ -150,7 +150,7 @@ Mono account = client.get() .url("/accounts/{id}", 1L) .accept(APPLICATION_JSON) .exchange(request) - .then(response -> response.bodyToMono(Account.class)); + .flatMap(response -> response.bodyToMono(Account.class)); ----