1515 */
1616package org .springframework .data .web ;
1717
18- import com .fasterxml .jackson .databind .DeserializationFeature ;
1918import com .fasterxml .jackson .databind .JavaType ;
2019import com .fasterxml .jackson .databind .ObjectMapper ;
2120import com .jayway .jsonpath .spi .json .JacksonJsonProvider ;
3938import reactor .core .publisher .Flux ;
4039import reactor .core .publisher .Mono ;
4140
42- import java .math .BigDecimal ;
4341import java .util .Map ;
4442import java .util .concurrent .atomic .AtomicReference ;
4543
4644/**
47- * {@link org.springframework.http.codec.HttpMessageDecoder} implementation to enable projected JSON binding to interfaces annotated with
48- * {@link ProjectedPayload}.
45+ * {@link org.springframework.http.codec.HttpMessageDecoder} implementation to enable projected JSON binding to
46+ * interfaces annotated with {@link ProjectedPayload}.
4947 *
5048 * @author Matías Hermosilla
5149 * @since 3.0
@@ -138,8 +136,8 @@ public boolean canDecode(ResolvableType elementType, @Nullable MimeType mimeType
138136 }
139137
140138 @ Override
141- public Flux <Object > decode (Publisher <DataBuffer > input , ResolvableType elementType ,
142- @ Nullable MimeType mimeType , @ Nullable Map <String , Object > hints ) {
139+ public Flux <Object > decode (Publisher <DataBuffer > input , ResolvableType elementType , @ Nullable MimeType mimeType ,
140+ @ Nullable Map <String , Object > hints ) {
143141
144142 ObjectMapper mapper = selectObjectMapper (elementType , mimeType );
145143 if (mapper == null ) {
@@ -150,7 +148,7 @@ public Flux<Object> decode(Publisher<DataBuffer> input, ResolvableType elementTy
150148
151149 return DataBufferUtils .join (processed , this .getMaxInMemorySize ())
152150 .flatMap (dataBuffer -> Mono .just (decode (dataBuffer , elementType , mimeType , hints )))
153- .expand (object -> {
151+ .flatMapMany (object -> {
154152 if (object instanceof Iterable ) {
155153 return Flux .fromIterable ((Iterable ) object );
156154 }
@@ -159,8 +157,8 @@ public Flux<Object> decode(Publisher<DataBuffer> input, ResolvableType elementTy
159157 }
160158
161159 @ Override
162- public Object decode (DataBuffer dataBuffer , ResolvableType targetType ,
163- @ Nullable MimeType mimeType , @ Nullable Map <String , Object > hints ) throws DecodingException {
160+ public Object decode (DataBuffer dataBuffer , ResolvableType targetType , @ Nullable MimeType mimeType ,
161+ @ Nullable Map <String , Object > hints ) throws DecodingException {
164162
165163 return projectionFactory .createProjection (ResolvableType .forType (targetType .getType ()).resolve (Object .class ),
166164 dataBuffer .asInputStream ());
0 commit comments