Cyrus Devnomad
03/21/2023, 1:24 PM{
"param1": [
"2"
],
"param2": [
"abc"
]
}
I have a bi-directional setting between my provider and my consumer.
I have intentionally changed the provider (ver-y, branch-y) API to not be compatible to the consumer (ver-x, branch-x) contract by offering only the parameter param1.
But when I publish the provider swagger.json file, the interaction consumer contract (ver-x, branch-x) vs provider (ver-y, branch-y) is shown as compatible and green. And when I execute can-i-deploy provider (ver-y, branch-y) to env1, the command passes and allows me to deploy the provider.
Shouldn't a provider API which misses some of the parameters the consumer expects, be considered as incompatible to that consumer? What could be the reason why my interaction is evaluated as compatible by Pactflow?Matt (pactflow.io / pact-js / pact-go)
The reason we didn’t do this in the first place is it becomes a blocker for fast 5 style changes where the consumer deploys first. For example if we wanted to add a new query param to an API in a world where unknown query params were disallowed then the provider has to change the Swagger file as the first step. Our thinking was that in general more teams would prefer the flexibility to deploy in any order over the strictness.We have created a tracking item to revisit this decision, in light of this report and real-world usage. I’m assuming you have found this behaviour surprising? Might I ask a follow up question. In your case, what is the impact of the provider not supported that query param? Does it simply filter the response or does it change the behaviour of the API in a way that would result in breaking the client?
Cyrus Devnomad
03/22/2023, 2:33 PMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Cyrus Devnomad
03/23/2023, 9:42 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)