GuidWildcardMatcher to match on GUIDs
See original GitHub issueIs your feature request related to a problem? Please describe.
I have been using the RegexMatcher
to do matches for paths with GUIDs, but after a while the Pattern
in the JSON mappings becomes unwieldly long in length when a few GUIDs are used.
Describe the solution you’d like
Would like a matcher to allow for matching a GUID (mostly in the Path
). For example:
-
Path
-http://localhost/v1.0/4a7eaad5-bbe7-4579-bb0b-7c85352fe1b6/task/edef5b4a-33bb-4920-bb42-1d5e6283984e
-
JSON mapping:
{ "Request" : { "Path": { "Matchers": [{ "Name": "GuidWildcardMatcher", "Pattern": "/*/{D}/task/{D}", "IgnoreCase": true }] } } }
Where the tokens used in the pattern match up with the GUID.ToString(string? format)
method as described here.
Describe alternatives you’ve considered
None - I can use the RegexMatcher
if the feature is not accepted.
Is your feature request supported by WireMock (java version)? Please provide details.
I do not believe this is supported in the java version (I did a search and couldn’t find anything that I could see)
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (9 by maintainers)
Thanks @StefH , I was able to pull the latest version and use this feature. Thanks again for being so open to my feature suggestion.
I could try to integrate it on my fork as a single class integrated and put up a PR. Would that be helpful?