pact-net
pact-net copied to clipboard
Requesting enhancement to update query param and body param in post call in provider state before pact verification
Hi , I found a post for JVM https://pactflow.io/blog/injecting-values-from-provider-states/ where we can modify the request before the validation, but is there a mechanism in C#?
I don't believe so.
You could achieve this by adding some custom middleware to your test application that can transform the incoming request.
Thank you @mefellows , @adamrodger- Could you let me know if we plan to add this for the upcoming versions, as currently we are adding some heavy middleware to support our chained requests.
I don't fully understand the feature request if I'm honest.
It would be really helpful if you could create a proposal for the API changes with an explanation of what the changes do, and then we can discuss about feasibility/design.
For example, see issue #392 for a good format for proposing changes.
to support our chained requests.
I'd be keen to understand this use case also. "chained requests" is an anti-pattern as far as contract testing is concerned, each request/response should be able to be tested in isolation.
Whilst the feature of essentially proxying incoming/outgoing bodies is doable, I'd be wary of adding features that readily enables improper use of the tool that will lead to future challenges for all parties.
Closed due to inactivity