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

Feature request - Response based on provider state #134

Open
foliv57 opened this issue Feb 8, 2022 · 1 comment
Open

Feature request - Response based on provider state #134

foliv57 opened this issue Feb 8, 2022 · 1 comment

Comments

@foliv57
Copy link

foliv57 commented Feb 8, 2022

Hi,

For now, if there is multiple matching interactions, the mock service return only one response.

From doc:
Where multiple matching interactions are found, the interactions will be sorted by response status, and the first one will be returned. This may lead to some non-deterministic behaviour.

To stay in line with the Pact philosophy and pact description, why not just introducing a custom HTTP header "X-Provider-State" to let the consumer set the expected provider state.

Like this, the mock service can know the response to produce based on the pact.

Regards

Thank you

@iku000888
Copy link

👍 on this!
Although what I gather from how https://github.com/pact-foundation/pact-provider-verifier behaves, the provider state will be communicated via an explicit POST request before the interaction step.

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