Skip to content

RedisJSON support should work out of the box without requiring Jackson #3431

@raphaeldelio

Description

@raphaeldelio

Feature Request

Is your feature request related to a problem? Please describe

Currently (6.8.1-RELEASE), if you use Lettuce’s RedisJSON commands (jsonSet, jsonGet, etc.) without adding the jackson dependency, you immediately get:

Could not load JsonParser, please consult the guideat https://redis.github.io/lettuce/user-guide/redis-json/

This means RedisJSON integration is effectively coupled to Jackson, unless you provide your own JsonParser implementation manually

That makes it difficult for projects that use other JSON libraries (like kotlinx.serialization or Gson), or that simply want to treat JSON values as opaque strings.

Describe the solution you'd like

Lettuce’s RedisJSON API should not force Jackson (or any parser) just to round-trip JSON.

With Jedis, the GET (or JSON.GET) API simply returns a String containing the JSON text. That string can then be passed to any JSON library (kotlinx.serialization, Gson, Moshi, Jackson, etc.) for deserialization. This is flexible and works out of the box, without coupling Jedis to a specific JSON library.

Lettuce could mirror this behavior:
• For jsonGet – if no JsonParser module is present, Lettuce should fall back to returning a raw String containing the JSON text from Redis. This gives developers the same convenience Jedis offers: get back the JSON string directly and decode it with whichever library they prefer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    size: small1 to 2 development weekstype: improvementAn improvement to the existing implementation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions