/oasis-prototype

Open API Specification Intel Services

Primary LanguageTypeScript

oasis

Open API Specification Intel Services

In a less fancy way: Oasis is a tool to automate testing of HTTP APIs, which uses Swagger or OAS specification files as source of data.

How it works

It reads an API specification file, finds paths, operations, description of data models and security schemes, then uses that data to run requests and validate responses.

When it needs specific data to send with request, such as headers, or path parameters, or POST bodies, it looks for it in the example field.

Building

npm i or npm build or npm watch

Using

npm run oasis \
	--reqCT="text/plain" \
	--respStatus=201 \
	--respCT="application/json" \

Selecting responses and requests

You can specify request content type to use and response status & content type to validate the received response against:

npm run oasis \
	--spec=specfile.yaml \
	--host="DevHost" \
	--op="Op Name" \
	--reqCT="text/plain" \
	--respStatus=201 \
	--respCT="application/json" \

Overriding request data

Since it's not always possible or reasonable to keep all the data neede for testing in the specification file, Oasis allows you to supply additional parameters and override existing ones:

npm run oasis \
	--spec=specfile.yaml \
	--host="DevHost" \
	--op="Op Name" \
	--reqCT="text/plain" \
	--respStatus=201 \
	--respCT="application/json" \
	--override.security.example="0000000XXXXX" \

This will replace the example value, used in request, with a new one.

TODO

Extend the --override functionality.
Scenario files to test complex interactions.
Golang port?