You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
Repository navigation
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
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.
@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.
@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.
Activity
michael-hawker commentedon Mar 20, 2020
@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.
simop-msft commentedon Mar 23, 2020
@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.