BigDecimal in multi-value request body deserializes differently than single-value #24479
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: backported
An issue that has been backported to maintenance branches
type: enhancement
A general enhancement
Milestone
Affects: spring-webflux:5.2.3.RELEASE
Given a WebFlux RestController has an endpoint mapped, with
@RequestBody
of typeFlux<BigDecimal>
and returns the first value of reactive stream as a response,when calling the endpoint with payload
[ -1E+2 ]
(array of floats written in E notation),then response contains
-100.0
, instead of-1E+2
.(Note: problem lays in deserialization of request body, not serialization of the response)
When request body is mapped as a single-value, i.e.
Mono<BigDecimal>
, the request body is not normalized and response looks as expected. Non-reactive servlet controller also works consistently, as expected, for both single-valueBigDecimal
request body and multi-valueList<BigDecimal>
.Test to reproduce (single-value testcase passes, multi-values testcase fails):
The text was updated successfully, but these errors were encountered: