[1.0.x] Fix nested Redis hash map conversion - #764
Merged
Merged
Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@RedisHashentities can persist and reloadMap<String, Object>values containing nested maps and collections.Validation
./gradlew :tests:test --tests "com.redis.om.spring.repository.HashWithNestedMapTest" --tests "com.redis.om.spring.convert.RedisOMCustomConversionsTest"failed 5 tests covering custom converter registration and nested map/list round trips../gradlew :tests:test --tests "com.redis.om.spring.repository.HashWithNestedMapTest" --tests "com.redis.om.spring.convert.RedisOMCustomConversionsTest"./gradlew :demos:roms-hashes:test --tests "com.redis.om.hashes.RomsHashesApplicationTests"./gradlew spotlessApply./gradlew spotlessCheck build aggregateTestReport -SCI Notes
.github/workflows/build.yml: PR jobs runspotlessCheck -S,assemble -S, sharded:tests:test -S, and:demos:build -S.spotlessCheck build aggregateTestReport -S.Note
Medium Risk
Changes core Redis OM serialization in
MappingRedisOMConverterfor all hash map/list fields; behavior is well covered by round-trip tests but affects a sensitive persistence path.Overview
Fixes gh-755 so
@RedisHashentities can save and reloadMap<String, Object>/List<Object>fields when values are nested maps or collections (e.g. JacksonLinkedHashMap/ArrayList), which previously failed withMappingExceptionon Spring Data Commons 3.2.4+.MappingRedisOMConverternow treats nestedMapandCollectionvalues inwriteInternalbeforegetRequiredPersistentEntity(), and reloads map/collection entries viareadNestedValue(including heuristic map vs list when the value type isObject).readMapOfSimpleTypesuses full key discovery and the entity class for nested reads.RedisOMCustomConversionsmerges caller-supplied converters with built-ins instead of replacing them.Regression coverage:
HashWithNestedMapTest,RedisOMCustomConversionsTest, demoUser.metadataandRomsHashesApplicationTests(Testcontainers).Reviewed by Cursor Bugbot for commit e4dd655. Bugbot is set up for automated code reviews on this repo. Configure here.