A CLI tool for comparing HTTP JSON APIs to ensure compatibility during migrations and refactoring
While rewriting some of IDAGIO micro-services back to monolith I came across a need to be able to compare HTTP JSON based APIs for both payload and HTTP header changes. Sadly all tools I came across were either too simple, lacking flexibility or lacking CLI interface. Well, then I decided it should be easy to write new one CLI tool…
APIDiff records HTTP API (JSON based) calls and compares them on both HTTP and JSON level. This is helpful when migrating or refactoring APIs to make sure your API contract did not change. It also stores basic performance metrics.
You can find core functionality as part of this asciinema recording bellow:
My intention was to have a quite lean small tool that covers only features listed below:
As of now, there is no OS package available and you have to have golang installed. After that you can use the following command:
$ go get gopkg.in/tgrk/apidiff.v1
This whole project is built around the concept of VCR/Cassette recording that is a great helper when your application integrates 3rd party services and IMO better way than using mocks written in your favourite programming language.