Initial support for bi-directional contracts (OAS/Swagger)
mefellows opened this issue · comments
Enable support for a bi-directional contract testing workflow with Open API Spec as the initial provider contract.
The initial workflow will support:
- A general provider-driven workflow
- Publishing of a valid OpenAPI spec (v3) from the provider, along with verification results to show the provider is compatible with the spec
- Consumer publishing Pact tests for a provider that has an OAS
- Pactflow will provide schema compatibility checks (e.g. during the
can-i-deploy
phase)
TODO
- support publishing of an arbitrary "contract" file, specifying the specific type
- support publication of provider self verification results from non-pact tools along with the provider contract
- modify can-i-deploy to allow OAS/pact verification to be taken into account when calculating results
- modify can-i-deploy to allow user to view pact/oas mismatches when can-i-deploy returns false
Deferred
* [ ] provide an endpoint to allow pact/OAS verification to be done before publishing a pact
Follow up:
- Rendering of the OAS and verification results in the Pactflow UI
See also https://pactflow.io/blog/the-curious-case-for-the-provider-driven-contract/ and pact-foundation/pact-specification#76 for some background.
Potential "evidence" to support:
-
Results of verifying a static OAS document against a running server
- Dredd
- Optic
- https://rest-assured.io/
-
Auto generated OAS from the code
-
Runtime OAS monitoring?
provide an endpoint to allow pact/OAS verification to be done before publishing a pact
We're going to defer this until after feedback from our developer preview group.
Note to self: Current oas verifiers say "We've seen no evidence that this spec is wrong" rather than "the code fully implements what is described in the spec"
Any update on this?
It's currently in developer preview, and you can use it now. You can see the docs for this: https://docs.pactflow.io/docs/workshops/bi-directional/
We're progressively rolling the UI support out for this over the next little while, so this has been kept as open whilst we are still in preview.