-
-
Notifications
You must be signed in to change notification settings - Fork 234
MappingSerializer (Newtonsoft or SystemText)-Json #1394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1394 +/- ##
==========================================
+ Coverage 34.85% 36.27% +1.42%
==========================================
Files 153 154 +1
Lines 37089 36891 -198
==========================================
+ Hits 12928 13384 +456
+ Misses 23725 23081 -644
+ Partials 436 426 -10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.