Skip to content

Conversation

smfields
Copy link
Contributor

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

Copy link
Collaborator

@StefH StefH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a new unit test for BodyDataMatchScoreCalculator which tests this scenario?

@smfields
Copy link
Contributor Author

@StefH I added a few new tests.

RequestMessageBodyMatcher_GetMatchingScore_BodyTypeJson_BodyAsBytes_ExactObjectMapper is the one that directly covers the scenario this PR addresses.

The other two are for covering the existing scenario of matching non-JSON strings or bytes.

@StefH StefH added the bug label Jul 30, 2025
@StefH StefH merged commit 6ccfe68 into wiremock:master Aug 2, 2025
6 checks passed
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