Skip to content
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

matching on path #186

Open
Liorba opened this issue Oct 25, 2020 · 4 comments
Open

matching on path #186

Liorba opened this issue Oct 25, 2020 · 4 comments

Comments

@Liorba
Copy link

Liorba commented Oct 25, 2020

hello,
I'm wondering if it possible to add matching rules on path/uri.
for example, I a provider service which accept GET request with id in the path foo/bar/:id
I want the stubbed server to ignore the actual id I send from my consumer service.
I saw that currently there is only matching rule on body and headers, but not on path although the pact v3 spec allows that.
I tried to add a custom rule to my "interaction" in the form of Some(List(ScalaPactMatchingRuleRegex("$.path", "/foo/bar/\\d+")))
but id didn't work.

if this is indeed possible, I would love your help on who to achieve this
Thanks!

@jbwheatley
Copy link
Contributor

jbwheatley commented Oct 28, 2020

Hi @Liorba. Path matching as you've described isn't supported by scala-pact, as we currently follow the v2 pact spec where paths must be an exact string match. I would suggest using some dummy id for all of you test cases instead.

@jbwheatley
Copy link
Contributor

Addendum: support could be added as part of the "non-strict" matching flow (which doesn't conform completely to the pace spec) 

@Liorba
Copy link
Author

Liorba commented Oct 28, 2020

Thanks for your answer @jbwheatley. when are you planning to add the support for v3?

@jbwheatley
Copy link
Contributor

I'm afraid it's not even on my radar at the moment. Its mainly just me actively maintaining things and my current focus is on slowly adding support for all the v2 features we are currently missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants