Hey @Rubem Ferreira ,
Welcome!
Very cool idea, it’s been on want list for many a moon.
First off I’d start with some terminology. OpenAPI, is formerly known as Swagger, with Swagger now referring to tools used to interact with Open API Documents/Specs referring to the document in yaml or Json.
I’m curious but unsure of the intristic value, in the real world. I know that swagger-codegen will allow for generation of both servers and client sdk’s.
The client sdk’s actually having at least stub tests in place for a unit testing framework.
It isn’t too much uplift to scaffold a basic pact test, in which the consumer could then record their expectations when they decide what they want to consumer on a particular providers endpoint, or remove anything they don’t wish to consume.
I wonder how many people use the codegens, and how well they help over time as a service evolves, and you have had to augment the initial generated client code.
Both myself and @Timothy Jones have discussed vscode snippets for each of the pact languages so it if easy to create the boilerplate for an interaction in any given language.
I hacked out how we could incorporate consumer expectations into an openAPI spec and generate consumer contract files ( pacts ) off the back of it.
These could be replaced by the real expectation in the future, when the consumer code is created.
I think @Matt (pactflow.io / pact-js / pact-go) would also be interested in this conversation.
Love to hear your thoughts and what you’ve got up to so far, if anything :)