Skip to content

Conversation

@StefH
Copy link
Collaborator

@StefH StefH commented Dec 16, 2025

No description provided.

@codecov
Copy link

codecov bot commented Dec 16, 2025

Codecov Report

❌ Patch coverage is 62.50000% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 36.27%. Comparing base (a5e75a7) to head (79f758f).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...ock.Net.Minimal/Serialization/MappingSerializer.cs 60.97% 16 Missing ⚠️
...ck.Net.Minimal/Serialization/MappingToFileSaver.cs 71.42% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a 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 MappingSerializer class that supports both Newtonsoft.Json and System.Text.Json converters
  • Added a MappingJsonSerializer property to WireMockServerSettings to allow customization of the JSON converter
  • Refactored existing deserialization methods from static helper methods in WireMockServer.Admin.cs to use the new MappingSerializer instance
  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants