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

UUID Matcher doesn't allow for specific example to be provided #266

Open
will-banked opened this issue Jan 31, 2023 · 1 comment
Open

UUID Matcher doesn't allow for specific example to be provided #266

will-banked opened this issue Jan 31, 2023 · 1 comment

Comments

@will-banked
Copy link

Software versions

  • OS: macOS 13.2
  • Consumer Pact library: pact-go v2.0.0-beta.17.0.20230119022944-5eda04090104
  • Provider Pact library: pact-go v2.0.0-beta.17.0.20230119022944-5eda04090104
  • Golang Version: 1.19
  • Golang environment: Provide output of go env

Expected behaviour

In pact-js the v3 UUID matcher will accept an example argument, and I'd like the same in pact-go as well, as we have some use cases where the UUID we need to use in the request to the provider is a specific one.
I wondered if it was because I was using v2 matchers in Go vs v3 in JS, but definitely haven't seen a /v3/matchers module to use instead.

Actual behaviour

Currently the UUID matcher auto generates a random UUID in the example, with no option to provide a specific UUID unless you use a non-UUID matcher instead.

Steps to reproduce

Relatively self evident.

Relevent log files

Not required

@mefellows
Copy link
Member

It should be noted, the current UUID matcher is just a regex (so you could just use a regex). I think the simplest option here is to create a new matcher UUIDv4(example string) that accepts an example, but uses the same regex.

What do you think?

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