Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

[Feature] Allow providing a custom JsonSerializer to BaseObjectStorageHelper #3175

Closed

Description

@simop-msft

Describe the problem this feature would solve

Currently, BaseObjectStorageHelper uses a private vanilla JsonSerializer. It means that a consumer of an ObjectStorageHelper cannot provide custom SerializationSettings (Converters, TypeNameHandling, TraceWriter...)

Describe the solution

Add the following constructor: BaseObjectStorageHelper(JsonSerializer jsonSerializer), and make the corresponding field readonly. That way, a consumer can customize the serializer at will.

Describe alternatives you've considered

The constructor could take a subset of options to initialize the JsonSerializer with internally. However, it gives less freedom to the consumer and is less maintainable.

Activity

  1. michael-hawker commented on Mar 20, 2020

    @michael-hawker
    Member

    @simop-msft thanks! This is good feedback. I know we're trying to remove the dependency in the long-run on Json.NET (see Issue #3060). I'm not familiar enough with System.Text.Json to know what the equivalent functionality is though.

  2. simop-msft commented on Mar 23, 2020

    @simop-msft
    ContributorAuthor

    @michael-hawker I opened #3181, to fit the needs I've exposed here for the short term. For System.Text.Json, I've found JsonSerializerOptions which has the same role as Json.NET's JsonSerializerOptions, however they expose completely different properties. That means that the downside of exposing this constructor is that it would create a breaking change when migrating to System.Test.Json.

  3. added this to the 6.1 milestone on Mar 27, 2020
  4. ghost locked as resolved and limited conversation to collaborators on May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions