PHP

Bash API Contract Testing

Bash terminal

We have been doing some API development at work, and at one point we started evaluating tools for API contract testing. One of the explored approaches was drafting a bash script that glued some native Linux tools together in order to achieve the desired results.

That’s how this tool came to be. It is a proof of concept (POC) used for API contract testing as a way to ensure that, given any number of API endpoints, a request R returns a proper response RP no matter what have been chaged at the endpoint side. Basically we wanted a way to get sure that the external contract of an endpoint is preserved even if we rewrite the whole thing in different language.

While this is shared for educational purposes, it can actually be used in real scenarios where you need to evaluate the structure of responses, and the nature of its elements.

Here’s the link to the Github repo.

Tagged , ,

Leave a Reply

Your email address will not be published. Required fields are marked *