An API mocker based in the OpenAPI 3.0 specification.
npm i -g open-api-mocker
open-api-mocker -s my-schema.json -w
open-api-mocker --help # To prompt every available setting.
docker run -v "$PWD/myschema.json:/app/schema.json" -p "5000:5000" jormaechea/open-api-mocker
Or to run an specific version
docker run -v "$PWD/myschema.json:/app/schema.json" -p "5000:5000" jormaechea/open-api-mocker:X.Y.Z`
You can set any parameter when running inside a docker container
docker run -v "$PWD/myschema.json:/app/schema.json" -p "3000:3000" jormaechea/open-api-mocker:X.Y.Z -s /app/schema.json -p 3000`
- Read yaml and json OpenAPI v3 schemas.
- Port binding selection
- Request parameters validation
- Request body validation
- Response body and headers generation based on examples or schemas
- Response selection based using
Prefer: statusCode=XXX
request header. - Request and response logging
- Servers basepath support
- API Authentication
Simply run npm t
Issues and PRs are welcome.