Hi All, for message pacts, can we have a failure w...
# pact-go
s
Hi All, for message pacts, can we have a failure when new key-pairs added by the provider to the JSON? since consumer expectation json got matcher $.type, existing test is passing when new key-pairs added to the struct model by provider.
v
Hi @Srinivas Nali ! I dont remember all the specs and if what you are asking is possible but I am curious about what is the reason you would like the verification to fail when new fields are added to the body. One of the advantages of Pact is that you only specify contracts for the things you care in your consumer, not for all the permutations of the message(s).
☝️ 1
m
No, pact won't fail if the provider returns additional keys
s
right, thanks guys. It is like models are not in sync by both parties, since provider got new key-pairs. Since Contract test failure would highlight any mismatches thought this new model update could be covered as well.
v
@Srinivas Nali what is the impact of the mismatch in your system? What would give a failure? Do you think that something would break if the provider starts sending extra parameters or you have other reasons to need a failure?
☝️ 1
s
hi @Vittorio Guerriero at the moment consumers not impacted due to existing expectations being met. All ok.
👍 1