Skip to content

Commit dce72e0

Browse files
committed
Change Mono#then to Mono#flatMap in documentation
Issue: SPR-15318
1 parent e3fae27 commit dce72e0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public class PersonHandler {
9494
Mono<ServerResponse> notFound = ServerResponse.notFound().build();
9595
Mono<Person> personMono = this.repository.getPerson(personId);
9696
return personMono
97-
.then(person -> ServerResponse.ok().contentType(APPLICATION_JSON).body(fromObject(person)))
97+
.flatMap(person -> ServerResponse.ok().contentType(APPLICATION_JSON).body(fromObject(person)))
9898
.switchIfEmpty(notFound);
9999
}
100100
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ Mono<Account> account = client.get()
150150
.url("/accounts/{id}", 1L)
151151
.accept(APPLICATION_JSON)
152152
.exchange(request)
153-
.then(response -> response.bodyToMono(Account.class));
153+
.flatMap(response -> response.bodyToMono(Account.class));
154154
----
155155

156156

0 commit comments

Comments
 (0)