Skip to content

dbraley/client-code-pact-contract-generation

 
 

Repository files navigation

Dave Notes

specifically with regard to pact-feign-consumer

see also Pact in go.

see also Pact in js.

My goal with this fork: Come up with an automated way to generate and upload pact contracts to a pact broker based on an underlying rest implementation. This is driven by noticing that frequently, pacts are generated by inferring from the swagger json (as are clients) which leads to provders not actually being able to understand how their services are being used, rather supporting one or more pacts that more or less validate the swagger (at best).

Ideally this mentality could be applied with ease to multiple client languages. As a provider, I want to make it easy for my clients to keep their pacts up to date regardless of what language they choose to program in.

Worthy of note: this technique would enable higher value of using swagger-mock-validator. Frequently, pact modification generally entails agreement (and sometimes negotiation) between teams. If the pact were automatically generated and uploaded by the build process, it is feasible (desirable?) the pact could drift. In such a case, validating the pact and swagger align is more valuable (and worth the extra effort in the build pipline, due to reduced engineer overhead).

Example Code Repository

Travis CI Status

This repo contains example projects which show how to use different (not only) Java technologies. The examples are usually accompanied by a blog post on https://reflectoring.io.

See the READMEs in each subdirectory of this repo for more information.

Java

All modules require Java 11 to compile and run.

Building with Gradle

The build is configured so that you can build all modules at once or each module separately.

Building all Modules at Once

In the main folder, run

./gradlew clean build

Building a Module Separately

In the folder of the module, run

./gradlew clean build

Non-Java Modules

Some folders contain non-Java projects. For those, refer to the README within the module folder.

About

A collection of code examples from blog posts etc.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 80.8%
  • JavaScript 12.3%
  • TypeScript 4.7%
  • HTML 1.3%
  • Other 0.9%