[PR #1339] [MERGED] Fixes an issue with matching JSON bodies as bytes #1347

Closed
opened 2025-12-29 09:19:23 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/wiremock/WireMock.Net/pull/1339
Author: @smfields
Created: 7/27/2025
Status: Merged
Merged: 8/2/2025
Merged by: @StefH

Base: masterHead: sfields/fix-body-bytes-issue


📝 Commits (3)

  • c138618 Fixes an issue with matching JSON bodies as bytes
  • 4ab09cd Adding tests for exact object matching
  • 0f42faf Simplify the check for byte data

📊 Changes

2 files changed (+79 additions, -10 deletions)

View changed files

📝 src/WireMock.Net.Shared/Matchers/Helpers/BodyDataMatchScoreCalculator.cs (+3 -7)
📝 test/WireMock.Net.Tests/RequestMatchers/RequestMessageBodyMatcherTests.cs (+76 -3)

📄 Description

Fixes an issue where body payloads would fail to be matched if the matcher was created using a byte[] value and the bytes represented valid JSON.

References

Submitter checklist

  • Recommended: Join WireMock Slack to get any help in #help-contributing or a project-specific channel like #wiremock-java
  • The PR request is well described and justified, including the body and the references
  • The PR title represents the desired changelog entry
  • The repository's code style is followed (see the contributing guide)
  • Test coverage that demonstrates that the change works as expected
  • For new features, there's necessary documentation in this pull request or in a subsequent PR to wiremock.org

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/wiremock/WireMock.Net/pull/1339 **Author:** [@smfields](https://github.com/smfields) **Created:** 7/27/2025 **Status:** ✅ Merged **Merged:** 8/2/2025 **Merged by:** [@StefH](https://github.com/StefH) **Base:** `master` ← **Head:** `sfields/fix-body-bytes-issue` --- ### 📝 Commits (3) - [`c138618`](https://github.com/wiremock/WireMock.Net/commit/c13861885612fc107d1ca9572835c634219e8596) Fixes an issue with matching JSON bodies as bytes - [`4ab09cd`](https://github.com/wiremock/WireMock.Net/commit/4ab09cde8b19eb98b6f4a9cc3c0b1c4df24eb894) Adding tests for exact object matching - [`0f42faf`](https://github.com/wiremock/WireMock.Net/commit/0f42faf26ce1a43e84ead1f05a2f7b7866e0e91c) Simplify the check for byte data ### 📊 Changes **2 files changed** (+79 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `src/WireMock.Net.Shared/Matchers/Helpers/BodyDataMatchScoreCalculator.cs` (+3 -7) 📝 `test/WireMock.Net.Tests/RequestMatchers/RequestMessageBodyMatcherTests.cs` (+76 -3) </details> ### 📄 Description Fixes an issue where body payloads would fail to be matched if the matcher was created using a `byte[]` value and the bytes represented valid JSON. ## References - #1338 ## Submitter checklist - [ ] Recommended: Join [WireMock Slack](https://slack.wiremock.org/) to get any help in `#help-contributing` or a project-specific channel like `#wiremock-java` - [x] The PR request is well described and justified, including the body and the references - [x] The PR title represents the desired changelog entry - [x] The repository's code style is followed (see the contributing guide) - [ ] Test coverage that demonstrates that the change works as expected - [ ] For new features, there's necessary documentation in this pull request or in a subsequent PR to [wiremock.org](https://github.com/wiremock/wiremock.org) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 09:19:23 +01:00
adam closed this issue 2025-12-29 09:19:23 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net#1347