Check your clients and servers are compliant with OpenAPI specifications
Check your clients and servers are compliant with OpenAPI specifications

This is a walkthrough of how you can check the compliance of an OpenAPI specification against a client (like a UI, CLI, or SDK) and server or actual API endpoint.

We will use an application called wiretap.


Watch the video

This video will walk you through the steps of checking the compliance of an OpenAPI specification against a client and server.


What is wiretap?

wiretap is an API compliance testing tool that allows us to ’tap-into’ requests and responses between clients and servers and validate that those requests and responses comply with the OpenAPI specification defined.

wiretap can also replace a local dev server, like webpack’s dev server, which can host a UI and proxy all the API calls to an endpoint.

More information about wiretap is available over on the pb33f wiretap site.


Installing wiretap

There are a few ways to install wiretap

Installing using homebrew

brew install pb33f/taps/wiretap

Installing using npm/yarn

npm install -g @pb33f/wiretap yarn global add @pb33f/wiretap

Installing using docker

docker pull pb33f/wiretap

Running wiretap using docker

docker run -p 9090:9090 -p 9091:9091 -p 9092:9092 --rm -v $PWD:/work:rw \ pb33f/wiretap -u https://somehostoutthere.com

Installing using curl

curl -fsSL https://pb33f.io/wiretap/install.sh | sh

Downloading the Example OpenAPI specification

curl -o giftshop-openapi.yaml https://api.pb33f.io/wiretap/giftshop-openapi.yaml

Running wiretap

Once you have wiretap installed, you can run it using the following command:

wiretap -s giftshop-openapi.yaml -u https://api.pb33f.io

Read the wiretap quickstart

This video is an extended version of the wiretap quickstart.

The giftshop API documentation is also available.