Skip to content

Commit 96fd5e4

Browse files
committed
fix: Change Redis cache serialization to WRAPPER_ARRAY format
- Fix SerializationException with List<EventDefinitionResponse> - Change from JsonTypeInfo.As.PROPERTY to WRAPPER_ARRAY - WRAPPER_ARRAY format is more compatible with collections - Resolves 500 error on /api/v1/events/active endpoint
1 parent aee4a63 commit 96fd5e4

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

core-service/src/main/java/com/axon/core_service/config/CacheConfig.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ private ObjectMapper cacheObjectMapper() {
3333
// Register Java 8 date/time module for LocalDateTime serialization
3434
mapper.registerModule(new JavaTimeModule());
3535

36-
// Enable polymorphic type handling to preserve class information in JSON
37-
// This allows Redis to deserialize objects back to their original types
36+
// Enable polymorphic type handling with WRAPPER_ARRAY format
37+
// This wraps type information in an array: ["com.example.Type", {...}]
38+
// More compatible with collections and complex types
3839
mapper.activateDefaultTyping(
3940
LaissezFaireSubTypeValidator.instance,
4041
ObjectMapper.DefaultTyping.NON_FINAL,
41-
JsonTypeInfo.As.PROPERTY
42+
JsonTypeInfo.As.WRAPPER_ARRAY // Changed from PROPERTY to WRAPPER_ARRAY
4243
);
4344

4445
return mapper;

0 commit comments

Comments
 (0)