Currently, with the bi-directional workflow consum...
# pactflow
e
Currently, with the bi-directional workflow consumers must upload a contract in Pact format. Wheras the provider uploads an OAS. Is support for consumers uploading an OAS (instead of Pact contract) on your roadmap?
m
It’s not currently - mind describing your use case a bit more?
e
Let's say the consumer grabs a copy of the OAS schema as it was at at point in time (version 1) and commits it to their (consumer) codebase. Perhaps (before committing) they manually remove some parts of the schema that they're not using (e.g. endpoints). The consumer codebase uses that schema to programtically generate types, maybe API client etc. Either the full or filtered schema v1 is published as the consumer contract. We check with the broker, broker performs OAS compatibility check, consumer can deploy. A bit later, provider wants to make some changes. They do so in a way that would be breaking (with regards to OAS). Because consumer is deployed and using that contract, provider cannnot deploy. Provider revises their changes, makes them non-breaking (e.g. by versioning an endpoint). Provider deploys OK. Even later, consumer grabs v2 of the OAS and commits it to their repo (types, API client etc are regenerated). Consumer deploys. It might at this point be possible for the provider to finally remove some of the deprecated endpoints. ✂️✂️✂️✂️ TL;DR: • It can save the consumer having to write contract-by-example tests • It can possibly allow more exhaustive checking (e.g. possible enum values) It's 100% not using Pact / PactFlow to it's full potential. Kind of like using
openapi-diff
- however, we're still benefiting hugely from the broker's knowledge of what is deployed where
m
thanks, I understand the use case now
I’ll pop a feature request in it so we can consider with other ideas we’re exploring. The biggest problem I see with this is that: 1. The OAD might be a superset of the consumer, which reduces the flexibility on the provider 2. The OAD could quite easily drift from the consumer, which is already a bit of a concern on the provider side. Having two documents that might not actually conform to reality…worries me 3. I suppose it’s possible for the OADs to have diverged significantly enough that a comparison might not even be possible (at which point, we’d have to just say “we’re confused, so we’ll default to ‘not compatible’”
But, I understand the desire. If you’re interested, we’ve been experimenting with a few ideas at PactFlow on improving contract testing. Think of it as a bit of a combination of Pact and BDCT, but hopefully better on both fronts. I could setup a time to get your reflections/feedback?
e
If you’re interested, we’ve been experimenting with a few ideas at PactFlow on improving contract testing. Think of it as a bit of a combination of Pact and BDCT, but hopefully better on both fronts
Keen to hear more about it!