spring-projects / spring-projects/spring-data-redis

Add Static Factory Method for JacksonJsonRedisSerializer

Open
#3,252 3 comments 0 reactions 1 assignee View on GitHub

@christophstrobl is already working on this.

Since Nov 3, 2025.

type: enhancement
Dominant language
Java
Stars
1.9k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

Hi Team,
Hope it is a simple request.

Can we add a static factory method for creating instances of JacksonJsonRedisSerializer in V 4.0?

Example:

JacksonJsonRedisSerializer<Person> serializer = JacksonJsonRedisSerializer.of(Person.class);

Alternatively, a static helper under RedisSerializer would be even better.

static <T> RedisSerializer<T> json(Class<T> type) {
    return new JacksonJsonRedisSerializer<>(type);
}

RedisSerializer<Person> serializer = RedisSerializer.json(Person.class);

That would greatly simplify typical RedisTemplate setup code and make examples cleaner for both documentation and developer experience.
Adding a factory method improves readability and aligns with modern Java API design conventions.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.