https://pact.io logo
#general
Title
# general
d

Daniel Flieger

05/10/2022, 6:58 AM
Hey there! We are currently writing a POC for pact to test the tool in-house. We already have written a provider & consumer with jvm which support pact specification V4. Now we startet to write a consumer with pactJs which only support pact specification V2. So we were wondering if it could cause problems when consumer write pacts in different specification versions or is this something which handles the broker/pactflow by itself? Thanks.
👋 1
m

Matt (pactflow.io / pact-js / pact-go)

05/10/2022, 7:00 AM
Good question Daniel.
Basically, it’s the provider that’s the lowest common denominator
d

Daniel Flieger

05/10/2022, 7:04 AM
Thank you for the fast feedback.
m

Matt (pactflow.io / pact-js / pact-go)

05/10/2022, 7:05 AM
Sorry, didn’t finish (just joined a meeting 😛 )
So, the spec version matters most to the provider
so if a consumer publishes a contract in V3 or V3 but the provider only supports up to V2, it won’t work
You can still specify the version to serialise in the consumer too. So if you are using Pact JVM which can produce V4 pacts, you can still set the consumer tests to generate a V2 pact
d

Daniel Flieger

05/10/2022, 7:13 AM
Are downwards compatible? So when the consumerA writes pacts in V4 & consumerB writes them in V2. Can the provider support both versions or should all parties use V2 then?
m

Matt (pactflow.io / pact-js / pact-go)

05/10/2022, 7:18 AM
Yes, it can verify V4 and below in that example
so the consumers don’t need to be compatible with the same version
🙏 1
3 Views