Skip to content

Add ability to pass in JsonSerializerOptions to generic Json Get<T> methods. #186

@MichaelDeutschCoding

Description

@MichaelDeutschCoding

Currently, there's no ability to customize the deserialization that happens behind the scenes when using JsonCommands.Get<T>() or JsonCommandsAsync.GetAsync<T>().

They both use the System.Text.Json's JsonSerializer Deserialize<TValue>(string, JsonSerializerOptions? options = default), which can accept a JsonSerializerOptions parameter to control how the deserialization is done. This means that users can not use the Redis json to command if they want case insensitive or any custom behavior (such as string-enum-converters).

I think it would be fairly simple to add an optional parameter to the JsonCommands to then use in its internal call to the JsonSerializer.

I'm happy to submit a PR if you'd like.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions