Skip to content

Commit 61ffbe5

Browse files
committed
Merge pull request #1844 from violetagg:fixes-in-docs
* pr/1844: Fix code examples for WebFlux functional endpoints
2 parents a7a29a8 + aed63d3 commit 61ffbe5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ For example:
3131
----
3232
import static org.springframework.http.MediaType.APPLICATION_JSON;
3333
import static org.springframework.web.reactive.function.server.RequestPredicates.*;
34+
import static org.springframework.web.reactive.function.server.RouterFunctions.route;
3435
3536
PersonRepository repository = ...
3637
PersonHandler handler = new PersonHandler(repository);
@@ -130,7 +131,7 @@ headers, or to provide a body. Below is an example with a 200 (OK) response with
130131
content:
131132

132133
Mono<Person> person = ...
133-
ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(person);
134+
ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(person, Person.class);
134135

135136
This is how to build a 201 (CREATED) response with `"Location"` header, and no body:
136137

0 commit comments

Comments
 (0)