Hello all! 👋
We currently define our API response models using Zod schemas, and we’re duplicating the same structure again in Pact matchers.
For example, instead of defining a response in Pact like:
account: { email: MatchersV3.string('user@automated.testing')}
we already have an Account object defined in a Zod schema that describes the same fields, types, and nullability.
Is there a recommended way to reuse or derive Pact contracts (or matchers) from existing Zod schemas, so we don’t have to redefine the same response objects in Pact and risk schema drift?
Or is the expected approach to define the response shape explicitly in Pact and treat the contract as the single source of truth?
Many thanks! :)