question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GuidWildcardMatcher to match on GUIDs

See original GitHub issue

Is 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:closed
  • Created 2 years ago
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
brogdoggcommented, Dec 13, 2021

Thanks @StefH , I was able to pull the latest version and use this feature. Thanks again for being so open to my feature suggestion.

1reaction
brogdoggcommented, Nov 18, 2021

I could try to integrate it on my fork as a single class integrated and put up a PR. Would that be helpful?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to check if two GUID match in .NET (C#)?
ToString() method of GUID will result consisten string value, so it can be used to match. Check this DotNetFiddle for this test. using...
Read more >
WireMock.Net.OpenApiParser 1.4.30
Version Downloads Last updated 1.5.35 319 2 days ago 1.5.34 19,086 17 days ago 1.5.32 72,588 a month ago
Read more >
Guid.CompareTo Method (System)
Compares this instance to a specified object or Guid and returns an indication of their relative values.
Read more >
How to validate GUID (Globally Unique Identifier) using ...
Given string str, the task is to check whether the given string is a valid GUID (Globally Unique Identifier) or not by using...
Read more >
Search for Guid matching value - Navisworks
Navisworks ModelItem supports a Guid field var guid = anItem.InstanceGuid; However, I can't find a dedicated way to search for item(s) with ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found