{"repo":"EXXETA/openapi-cop","free":true,"listed":false,"github":"https://github.com/EXXETA/openapi-cop","clone":"git clone https://github.com/EXXETA/openapi-cop.git","description":"A proxy that validates responses and requests against an OpenAPI document. https://www.npmjs.com/package/openapi-cop https://hub.docker.com/r/lxlu/openapi-cop","language":"TypeScript","stars":370,"topics":["proxy","swagger","openapi","validation","data-validation","contract-testing"],"license":"MIT","category":"networking-infra","readme_excerpt":"openapi-cop OpenAPI Co mpliance P roxy that validates requests and responses against an OpenAPI document The idea is to place the proxy between a client (e.g. a frontend app) and a web server to catch invalid requests or responses during development. Use this proxy locally or set it up in your development server. In production environments, set the silent flag to forward unmodified response bodies. In any case, validation headers are set that allow to trace down violations to your OpenAPI definition. Requirements We run all tests with Node.js versions 10 and 12. Higher versions could possibly work but are not currently supported. Installation To install the CLI globally: To install the package locally (inside an existing NPM package) and run the proxy programatically: Usage There are three ways to run openapi-cop: 1. Start it with the CLI (1). 2. Run it programatically inside Node.js (2). 3. Start a container based on the Docker image (3). CLI Usage The openapi-cop node package installs itself as an executable linked as openapi-cop . Run the command with the --help flag to get information about the CLI: The proxy validates the requests and responses in the communication with a target server. By default, the proxy will respond with a 500 status code when the validation fails. Sample validation failure response Two headers are added to the response: - openapi-cop-validation-result : contains the validation results as JSON. Interface - openapi-cop-source-request : contains a sim","default_branch":null,"files":null,"tree":[],"storefront":"/r/EXXETA","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/EXXETA/openapi-cop/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}