openapi-mockery
v0.1.1
Published
Run a mock server based on an OpenAPI schema
Downloads
6
Readme
openapi-mockery
OpenAPI Mockery is a tool for generating mock server from OpenAPI specification.
Installation
$ npm install --save-dev openapi-mockery
Usage
Run following scripts to generate mock server from OpenAPI specification.
- Copy your OpenAPI specification to the root of your project
$ npx openapi-mockery-fetch --apiDocsUrl=http://localhost:8080/api-docs --outputFile=./openapi.json
- Generate mock data from OpenAPI specification
$ npx openapi-mockery-generate-mocks --openApiSpecFile=./openapi.json --mocksFile=./mock-data.json
- Start mock server
$ npx openapi-mockery-server --mocksFile=./mock-data.json --port=3000 --name my-mock-server --verbose