Skip to content

Commit 48871fe

Browse files
committed
fix: make JsonUtils.objectMapper the default mapper for de/serialization
1 parent 9ac0c75 commit 48871fe

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,33 @@
11
package org.lowcoder.api.framework.configuration;
22

3+
import com.fasterxml.jackson.databind.ObjectMapper;
4+
import lombok.RequiredArgsConstructor;
35
import org.lowcoder.api.framework.plugin.endpoint.ReloadableRouterFunctionMapping;
46
import org.springframework.context.annotation.Configuration;
7+
import org.springframework.http.codec.ServerCodecConfigurer;
8+
import org.springframework.http.codec.json.Jackson2JsonDecoder;
9+
import org.springframework.http.codec.json.Jackson2JsonEncoder;
510
import org.springframework.web.reactive.config.WebFluxConfigurationSupport;
611
import org.springframework.web.reactive.function.server.support.RouterFunctionMapping;
712

13+
@RequiredArgsConstructor
814
@Configuration
915
public class CustomWebFluxConfigurationSupport extends WebFluxConfigurationSupport
1016
{
17+
private final ObjectMapper objectMapper;
18+
1119
@Override
1220
protected RouterFunctionMapping createRouterFunctionMapping()
1321
{
1422
return new ReloadableRouterFunctionMapping();
1523
}
24+
25+
26+
@Override
27+
protected void configureHttpMessageCodecs(ServerCodecConfigurer configurer) {
28+
configurer.defaultCodecs()
29+
.jackson2JsonDecoder(new Jackson2JsonDecoder(objectMapper));
30+
configurer.defaultCodecs()
31+
.jackson2JsonEncoder(new Jackson2JsonEncoder(objectMapper));
32+
}
1633
}

0 commit comments

Comments
 (0)