We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5059635 + 0913357 commit bc2dbd3Copy full SHA for bc2dbd3
1 file changed
src/main/java/com/fund/stockProject/global/config/RedisConfig.java
@@ -28,7 +28,11 @@ public class RedisConfig {
28
public ObjectMapper redisCacheObjectMapper() {
29
ObjectMapper mapper = new ObjectMapper();
30
mapper.registerModule(new JavaTimeModule());
31
- // 타입 정보를 포함하지 않도록 설정 (클린한 JSON)
+ // 캐시에 저장된 객체를 원래 타입으로 복원하기 위해 타입 정보를 포함
32
+ // (GenericJackson2JsonRedisSerializer 사용시 복원 시 LinkedHashMap으로 읽히는 문제 해결)
33
+ mapper.activateDefaultTyping(LaissezFaireSubTypeValidator.instance,
34
+ ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.PROPERTY);
35
+
36
return mapper;
37
}
38
0 commit comments