Hey team! Just to confirm.... we have a consumer w...
# pactflow
n
Hey team! Just to confirm.... we have a consumer which is an iOS application where we can't apply bi-dirctional contract testing because none of supported tools are being used, and then we have a provider where we can apply bi-directional feature because Postman and SwaggerHub are used. So is it compatible to apply bi-directional feature in the provider side with a non-bi-directional (iOS app) in the consumer side? thanks in advance
👋 1
y
Hey hey, For BDCT, you currently need an OpenAPI definition on one side (plus verification results) as your provider contract (more specification def types to be supported in the future) Consumer side you need a consumer contract, which is a Pact file. You can generate this with a client library, there is part dart consumer, and pact-swift depending. Also remember the bi-directional is a trade-off are you are not directly verifying the pact contents against a running provider, as you would do in CDCT, so it is worth considering and trialling out both options.
☝️ 2
We can use the pact provider verifier standalone or in a client library for CDCT, from the provider side for issuing the requests made in the consumer contract to the provider. You could use this additional layer somewhere to augment BDCT depending on your flow, to give you added security. Thinking more widely about the pact provider verifiers role, currently it only reads pact files. If it could read an OAS and issue those requests, it could be the one to verify that the provider contract is valid (as in the implementation matches the definition) rather than currently offsetting that the providers functional testing tool. That was a conscious design choice as it allows users to present a definition only, without valid test results from a real or even mock implementation, to facilitate the collaborative nature of design first development
That's been on our mind for a while https://github.com/pactflow/roadmap/issues/31
m
Hey team! Just to confirm.... we have a consumer which is an iOS application where we can’t apply bi-dirctional contract testing because none of supported tools are being used,
what do you mean by this Nerea? So long as you can produce a pact file it should be compatible with the backend (with the caveats Yousaf has mentioned)