Newtonsoft.Json.JsonReaderException: 'Unable to read the JSON string.' when using IStringMatcher with an empty body #682

Closed
opened 2025-12-29 15:30:47 +01:00 by adam · 0 comments
Owner

Originally created by @jollyjoyce1995 on GitHub (Apr 16, 2025).

Describe the bug

When using the IStringMatcher (tried it with JmesPathMatcher and JsonPathMatcher) and having an empty body (not null, empty string) an error gets logged (doesnt break execution) to console

Expected behavior:

No error message is emitted, resulting in clean output.

Test to reproduce

  • Add a mapping with a JmesPathMatcher or JsonPathMatcher
  • Request with HTTP Post, without body
  • Error gets logged
Originally created by @jollyjoyce1995 on GitHub (Apr 16, 2025). ### Describe the bug When using the IStringMatcher (tried it with JmesPathMatcher and JsonPathMatcher) and having an empty body (not null, empty string) an error gets logged (doesnt break execution) to console ### Expected behavior: No error message is emitted, resulting in clean output. ### Test to reproduce - Add a mapping with a JmesPathMatcher or JsonPathMatcher - Request with HTTP Post, without body - Error gets logged
adam added the bug label 2025-12-29 15:30:47 +01:00
adam closed this issue 2025-12-29 15:30:47 +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-wiremock#682