-
-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generating path
with fromProviderState
and matching path
using Regex
#1089
Comments
This is a @uglyog question I think. I don't think we currently support this do we? |
You can't use a regex matcher with the From the Pact file, you can see it is just taking the second parameter and calling
|
Yes, this is what we found and the reason this issue exists. Are such URL patterns uncommon with Pact users? |
This is the first time I've seen anyone needing to do this. To support this, the regex matcher will need to be defined after the |
It's not that the URL pattern is uncommon, it's the specific set of features needed. I'll have to think about how we can support it, perhaps in a V4 interface. |
Software versions
Issue Checklist
Please confirm the following:
Expected behaviour
In my project we have a situation where a URL path contains a provider state-generated string (
buildingId
):We also use the Pact stub server for client-side development and need to match paths received by the stub server against this URL pattern.
A teammate defined the interaction like this (excerpt):
This left us with this Pact JSON file (excerpt):
...which contains the string representation of the Regex matcher above as the example path. The
generator
element looks fine and the provider can be verified with a dynamic provider-generatedbuildingId
.What we rather want is a
matchingRules
entry that adheres to the URL pattern for the/plans/buildings/${buildingId}/floors
path. The JSON above would match any string, essentially capturing all requests.The following JSON contains the path matcher we wish for was generated from this piece:
Is this possible? If yes, how?
I imagine this URL pattern is not uncommon, but I could not find any examples. The only Stack Overflow question I could find has been kind of inactive with no solution provided.
The text was updated successfully, but these errors were encountered: