Skip to content

[1.0.x] Fix nested Redis hash map conversion - #764

Merged
sagile merged 1 commit into
1.0.x-spring-boot-3.4from
fix/755-nested-map-1.0
Jun 22, 2026
Merged

sagile merged 1 commit into
1.0.x-spring-boot-3.4from
fix/755-nested-map-1.0

Conversation

@sagile

@sagile sagile commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Validation

  • Fail-first check: with only the new tests on the 1.0.x baseline, ./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 -S

CI Notes

  • Reviewed .github/workflows/build.yml: PR jobs run spotlessCheck -S, assemble -S, sharded :tests:test -S, and :demos:build -S.
  • Local full validation covered the same formatting, build, tests, demos, and aggregate report surfaces via spotlessCheck build aggregateTestReport -S.

Note

Medium Risk
Changes core Redis OM serialization in MappingRedisOMConverter for all hash map/list fields; behavior is well covered by round-trip tests but affects a sensitive persistence path.

Overview
Fixes gh-755 so @RedisHash entities can save and reload Map<String, Object> / List<Object> fields when values are nested maps or collections (e.g. Jackson LinkedHashMap / ArrayList), which previously failed with MappingException on Spring Data Commons 3.2.4+.

MappingRedisOMConverter now treats nested Map and Collection values in writeInternal before getRequiredPersistentEntity(), and reloads map/collection entries via readNestedValue (including heuristic map vs list when the value type is Object). readMapOfSimpleTypes uses full key discovery and the entity class for nested reads.

RedisOMCustomConversions merges caller-supplied converters with built-ins instead of replacing them.

Regression coverage: HashWithNestedMapTest, RedisOMCustomConversionsTest, demo User.metadata and RomsHashesApplicationTests (Testcontainers).

Reviewed by Cursor Bugbot for commit e4dd655. Bugbot is set up for automated code reviews on this repo. Configure here.

@sagile
sagile requested a review from foogaro as a code owner June 19, 2026 21:16
@jit-ci

jit-ci Bot commented Jun 19, 2026

Copy link
Copy Markdown

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@sagile
sagile merged commit 798b1f7 into 1.0.x-spring-boot-3.4 Jun 22, 2026
10 checks passed
@sagile
sagile deleted the fix/755-nested-map-1.0 branch June 22, 2026 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant