Skip to content

RapiMock documentation

RapiMock serves every operation of your OpenAPI spec over HTTP. It validates requests, checks tokens, and with --stateful keeps what you create, so a frontend, a test suite or another service can call your API before it exists. What it does and how it compares with the in-browser mock of <rapi-doc> is on RapiMock's page.

npm install -D @rapidoc/cli @rapidoc/mock
npx rapidoc mock openapi.yaml --stateful

The reference lists every CLI option, the control API, every key of mock.config.yaml and every lint rule. To see what RapiMock makes of a spec without installing anything, use the spec check.

What it handles

RapiMock reads the data model off the spec. It does that well for APIs with ids in the path and keys at the top of a record, and needs a few lines of config for other styles. See which, with examples.