-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Description
Athul opened SPR-14586 and commented
The response from spring-reactive-web controller given an invalid JSON data.
Example :
If the return value of a controller is Flux<Student> and assume there are four items the output is in the following format
[{"age":1,"name":"Tom"},{"age":2,"name":"Tom"}{"age":3,"name":"Tom"}{"age":4,"name":"Tom"},,]
The ordering of the data and the delimiter is getting lost while encoding the data from Flux<Student> to Flux<DataBuffer>.
I think the root cause of the issue is org.springframework.http.codec.json.Jackson2JsonEncoder.encode() has a particular step where Data and Delimiter are merged to a single flux. However currently it is using flatMap which leads to loosing of order. Instead if concatMap was used the order between data and delimiter would have been retained.
Affects: 5.0 M1
Referenced from: commits 417a9d4