hevans90 / oa3-api-defender

A node.js CLI to validate an OA3 spec's response schemas versus real API endpoints
17 stars 0 forks source link

NPM

buddy pipeline semantic-release

Open Api 3 <--> RESTFul API Defender

This tool was moved from @ten-group/oa3-api-defender (which is now deprecated).

This tool is a CLI that parses an Open Api 3 Specification, calls a real API based on the spec's paths & associated response schemas, and provides command line validation on the output.


Installation

npm install oa3-api-defender --dev

yarn add oa3-api-defender --dev

Usage

npx oa3-def validate --specPath=<path_to_yaml_spec> --url=<URL_of_API>

{
  headers: {
    Authorization: 'YOUR AUTH STRING HERE'
  }
}

Alt text

Requests with path (/path{id}) or query (/path?query=1&nice=2) will be called only if the OA3 spec contains valid examples for the parameters:

Alt text

Known Issues/WIPs