MappingSerializer (Newtonsoft or SystemText)-Json#1394
MappingSerializer (Newtonsoft or SystemText)-Json#1394
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1394 +/- ##
==========================================
- Coverage 34.56% 34.46% -0.11%
==========================================
Files 155 156 +1
Lines 35228 35564 +336
==========================================
+ Hits 12176 12256 +80
- Misses 22764 22990 +226
- Partials 288 318 +30 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR refactors the mapping deserialization logic to support multiple JSON converters (Newtonsoft.Json or System.Text.Json) for MappingModel serialization. The changes introduce a new MappingSerializer class that abstracts the JSON conversion logic and allows users to configure which JSON converter to use via WireMockServerSettings.
Key Changes
- Introduced a new
MappingSerializerclass that supports both Newtonsoft.Json and System.Text.Json converters - Added a
MappingJsonSerializerproperty toWireMockServerSettingsto allow customization of the JSON converter - Refactored existing deserialization methods from static helper methods in
WireMockServer.Admin.csto use the newMappingSerializerinstance - Added comprehensive unit tests covering both JSON converters with various edge cases
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| test/WireMock.Net.Tests/Serialization/MappingSerializerTests.cs | New test file with comprehensive coverage for MappingSerializer using both Newtonsoft.Json and System.Text.Json converters |
| src/WireMock.Net.Shared/Settings/WireMockServerSettings.cs | Added new property to configure the JSON converter for mapping serialization |
| src/WireMock.Net.Minimal/WireMock.Net.Minimal.csproj | Updated package references to include JsonConverter packages for different target frameworks |
| src/WireMock.Net.Minimal/Server/WireMockServer.cs | Added MappingSerializer field and initialization with configured or default JSON converter |
| src/WireMock.Net.Minimal/Server/WireMockServer.ImportWireMockOrg.cs | Updated to use the new MappingSerializer instance instead of static methods |
| src/WireMock.Net.Minimal/Server/WireMockServer.Admin.cs | Refactored static deserialization methods to use MappingSerializer; moved method and removed old implementation |
| src/WireMock.Net.Minimal/Serialization/MappingSerializer.cs | New internal class that handles deserialization of JSON to arrays, supporting both Newtonsoft.Json and System.Text.Json |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.