-
-
Notifications
You must be signed in to change notification settings - Fork 233
Open
Labels
Description
WireMock.Net forces me to use Newtonsoft.Json as the only serialization option. In modern .NET applications that have migrated to System.Text.Json, this creates dependency conflicts, performance overhead, and inconsistent serialization behavior between production code and test mocks. When my application uses System.Text.Json with specific naming policies and converters, WireMock's Newtonsoft.Json serialization can produce different results, leading to unreliable tests that don't accurately reflect production behavior.
I would like WireMock.Net to support configurable JSON serialization, allowing users to choose between Newtonsoft.Json (current default) and System.Text.Json. This could be implemented through:
// Configuration option
WireMockServer.Start(new WireMockServerSettings
{
JsonSerializer = JsonSerializerType.SystemTextJson
});
// Or fluent API
var server = WireMockServer
.Start()
.UseSystemTextJson()
.WithSettings(settings);Additional context
System.Text.Jsonoffers significantly better performance (up to 2x faster serialization)- Many .NET 5+ projects have migrated away from
Newtonsoft.Json - Microsoft recommends
System.Text.Jsonfor new applications - This feature would help WireMock.Net stay current with .NET ecosystem trends
- Backward compatibility can be maintained by keeping
Newtonsoft.Jsonas the default option - Would be valuable for high-throughput testing scenarios where serialization performance matters