Hi Guys, a simple question If consumer contract contains properties not defined in provider contract for this pactflow doesn't throw any error. I want to understand if validation should be there in pactflow for such scenario or not ?
m
Matt (pactflow.io / pact-js / pact-go)
10/03/2022, 10:32 AM
Can you please share an example of what you mean? The answer to this question is complicated, but the general answer is that it should fail if the consumer needs properties that don’t exist (if it sends properties that don’t exist, that’s not an issue)
a
Ashok
10/03/2022, 10:41 AM
Sure, suppose actual data model contains properties A,B,C but as of now only A,B properties have been published in provider contract but consumer sends all A,B,C properties then I am expecting validation error for C as this does not exists for consumer
m
Matt (pactflow.io / pact-js / pact-go)
10/03/2022, 11:52 AM
Sending an additional value is always safe for a provider. It would just ignore the field it doesn’t know about
a
Ashok
10/04/2022, 6:58 AM
Indeed, incase of actual API I do agree but incase of contract situation is different. In my situation API is already implemented and now we are creating the provider contract which doesn't contain all the properties as this is a very complex single API which is being consumed by lot of calling applications. Now schema varies according to the calling applications so this happens that not all properties are present in the provider contract.
So in current situation we are not able to find the gaps as well which doesn't give consumers also the confidence to rely on PactFlow tool as this doesn't identify the gap in this context.
m
Matt (pactflow.io / pact-js / pact-go)
10/04/2022, 7:10 AM
Can you please share the consumer and provider contract?
Matt (pactflow.io / pact-js / pact-go)
10/04/2022, 7:10 AM
I'm not sure I understand what you're asking, so seeing an example might help