Sitelet https://github.com/wiremock/WireMock.Net/issues/1473
Skip to content

JsonPartialWildCardMatcher With DateTime Regex Stopped Matching (Regression?) #1473

Description

@epDugas

Describe the bug

JsonPartialWildcardMatcher with "Regex": true does not match a JSON body field containing an ISO-8601 date string when the mapping pattern uses a regex for that field.

Expected behavior:

An existing static mapping in our project was working, and then stopped matching when upgrading from version 2.0 to 2.10. Working on pinned 2.2
First noticed breakage on our CI/CD through usage of Wiremock.Net Test Container when it pulled 2.10 image.

Below is a minimal example demonstrating the issue:

Test to reproduce

Example Static Mapping

{
  "Guid": "11111111-1111-1111-1111-111111111111",
  "Request": {
    "Path": {
      "Matchers": [
        {
          "Name": "ExactMatcher",
          "Pattern": "/test"
        }
      ]
    },
    "Methods": [
      "POST"
    ],
    "Headers": [
      {
        "Name": "Content-Type",
        "Matchers": [
          {
            "Name": "ExactMatcher",
            "Pattern": "application/json"
          }
        ]
      }
    ],
    "Body": {
      "Matcher": {
        "Name": "JsonPartialWildcardMatcher",
        "Pattern": {
          "date": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2})$",
          "id": 1
        },
        "Regex": true
      }
    }
  },
  "Response": {
    "StatusCode": 200,
    "Body": "matched"
  }
}

Example Request

curl -i \
  -X POST "http://localhost:9091/test" \
  -H "Content-Type: application/json" \
  -d '{"date":"2026-06-09T22:23:18.53421+00:00","id":1}'

Result

HTTP/1.1 404 Not Found
No matching mapping found

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions