title: OpenAPI Generator vs. CDC Testing with Pact
body: <p>We're overhauling our frontend and backend service contract reliability and are investigating two tools/techniques that seem to conflict. Consumer and provider code generation from an OpenAPI Spec (OAS) with a tool like <a href="https://openapi-generator.tech/" rel="nofollow noreferrer">openapi generator</a> vs. consumer driven contract (CDC) testing with a tool like <a href="https://pact.io/" rel="nofollow noreferrer">pact</a>.</p>
  <p><em><strong>OAS Code Generation</strong></em></p>
  <p>OAS works great for generating the consumer code, and we're working on integrating provider-side generation to complete the contract confidence on both sides. As long as contract alterations start w/ the OAS and providers and consumers generate their code, is this a suitable strategy?</p>
  <p><em><strong>Pact Unit Testing</strong></em></p>
  <p>Pact CDC testing doesn't seem to involve an OAS at all, but instead programmatically builds contracts between the consumer and provider via unit testing. When using a pact broker, the addition of the <a href="https://docs.pact.io/pact_broker/can_i_deploy" rel="nofollow noreferrer">can-i-deploy</a> tool seems like a nice addition to a ci/cd pipeline. One nice thing w/ pact is that it appears to support kafka event mocking, which would be something openapi-generator doesn't cover.</p>
  <p>If every service, front and back, is using OAS code generation, is pact useful? I could see it's utility in an environment without codegen, but otherwise starts to feel redundant/conflicting.</p>
  <p>Thanks for any insight or anecdotes you can provide!</p>