Request Matching Wiki - include JSON example (specification) of each matching part available #492

Closed
opened 2025-12-29 15:25:08 +01:00 by adam · 1 comment
Owner

Originally created by @MichaelIDS on GitHub (Feb 20, 2023).

Originally assigned to: @StefH on GitHub.

At present on this section of the Wiki, there isn't a clear list of what the names of matching parts are and if they are single objects or arrays.
https://github.com/WireMock-Net/WireMock.Net/wiki/Request-Matching#one-request-matching

Ideally, a table or a simple JSON example of each would be ideal, like there is for Query Parameters.
https://github.com/WireMock-Net/WireMock.Net/wiki/Request-Matching#query-parameters

Most of the matching parts can be found somewhere on that page via a search under one of the Matchers, however, I couldn't find any example of the 'Url' matching part.
I found it was Matchers (multiple) via trial and error.

"Url": {
    "Matchers": [
        {
            "Name": "RegexMatcher",
            "Pattern": "/clients[?]"
        }
    ]
}

Also, it seems that some matching part types can't be used together. I hit this when trying to use 'Url' and 'Path' together. After a GitHub search and looking at code results, I noticed this:
b1032c9dcd/src/WireMock.Org.Abstractions/Request.cs (L11)
So just moved the logic from my Path into the Url and combined them into a single Regex to trigger when any parameters are provided for a specific URL.

Originally created by @MichaelIDS on GitHub (Feb 20, 2023). Originally assigned to: @StefH on GitHub. At present on this section of the Wiki, there isn't a clear list of what the names of matching parts are and if they are single objects or arrays. https://github.com/WireMock-Net/WireMock.Net/wiki/Request-Matching#one-request-matching Ideally, a table or a simple JSON example of each would be ideal, like there is for Query Parameters. https://github.com/WireMock-Net/WireMock.Net/wiki/Request-Matching#query-parameters Most of the matching parts can be found somewhere on that page via a search under one of the Matchers, however, I couldn't find any example of the 'Url' matching part. I found it was Matchers (multiple) via trial and error. ```json "Url": { "Matchers": [ { "Name": "RegexMatcher", "Pattern": "/clients[?]" } ] } ``` Also, it seems that some matching part types can't be used together. I hit this when trying to use 'Url' and 'Path' together. After a GitHub search and looking at code results, I noticed this: https://github.com/WireMock-Net/WireMock.Net/blob/b1032c9dcdb9acee3915ac7f92b7bffb1bd1cf7e/src/WireMock.Org.Abstractions/Request.cs#L11 So just moved the logic from my `Path` into the `Url` and combined them into a single Regex to trigger when any parameters are provided for a specific URL.
adam added the doc label 2025-12-29 15:25:08 +01:00
adam closed this issue 2025-12-29 15:25:11 +01:00
Author
Owner

@StefH commented on GitHub (Aug 10, 2023):

Wiki updated.

https://github.com/WireMock-Net/WireMock.Net/wiki/Request-Matching

@StefH commented on GitHub (Aug 10, 2023): Wiki updated. https://github.com/WireMock-Net/WireMock.Net/wiki/Request-Matching
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#492