Remove bodyWithType extension from WebFlux
Since there is no more clash with the new bodyValue method name. Closes gh-23523
This commit is contained in:
@@ -231,8 +231,8 @@ ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(person, Person.
|
||||
[source,kotlin,role="secondary"]
|
||||
.Kotlin
|
||||
----
|
||||
val person: Mono<Person> = ...
|
||||
ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).bodyWithType<Person>(person)
|
||||
val person: Person = ...
|
||||
ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).bodyValue(person)
|
||||
----
|
||||
|
||||
The following example shows how to build a 201 (CREATED) response with a `Location` header and no body:
|
||||
@@ -262,7 +262,7 @@ ServerResponse.ok().hint(Jackson2CodecSupport.JSON_VIEW_HINT, MyJacksonView.clas
|
||||
[source,kotlin,role="secondary"]
|
||||
.Kotlin
|
||||
----
|
||||
ServerResponse.ok().hint(Jackson2CodecSupport.JSON_VIEW_HINT, MyJacksonView::class.java).bodyWithType(...)
|
||||
ServerResponse.ok().hint(Jackson2CodecSupport.JSON_VIEW_HINT, MyJacksonView::class.java).body(...)
|
||||
----
|
||||
====
|
||||
|
||||
|
||||
@@ -497,7 +497,7 @@ like `Mono` or Kotlin Coroutines `Deferred` as the following example shows:
|
||||
client.post()
|
||||
.uri("/persons/{id}", id)
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.bodyWithType<Person>(personDeferred)
|
||||
.body<Person>(personDeferred)
|
||||
.retrieve()
|
||||
.awaitBody<Unit>()
|
||||
----
|
||||
@@ -524,7 +524,7 @@ You can also have a stream of objects be encoded, as the following example shows
|
||||
client.post()
|
||||
.uri("/persons/{id}", id)
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.bodyWithType(people)
|
||||
.body(people)
|
||||
.retrieve()
|
||||
.awaitBody<Unit>()
|
||||
----
|
||||
|
||||
Reference in New Issue
Block a user