RapiDocRapiDocv14.2
rapidoc mock • @rapidoc/mock

RapiMock

Your OpenAPI spec as a server that remembers. RapiMock serves every operation of your spec, validates requests, checks tokens, and keeps what you create, so a POST shows up in the next GET. No code to write.

RapiMock as a server on port 4010, built from openapi.yaml with a store beside it: your frontend, an AI agent, a test run and curl send it requests and get 201, 200, 400 and 403 back
One Command

A Mock That Keeps What You Send

Point rapidoc mock at a spec. Each API is served under its own path on port 4010; with--stateful, records you create are there when you read or list them, until you reset.

Your frontend, your tests, <rapi-doc>'s Try and an MCP server can all call it, the way they will call the real API.

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

curl -X POST localhost:4010/openapi/pets \
  -H "Content-Type: application/json" -d '{"name":"Biscuit"}'
curl localhost:4010/openapi/pets        # Biscuit is in the list
Every Request

Checked Like the Real API, Kept Like a Real One

A request that doesn't match the spec gets a 400 with the problems listed. A token is checked against your issuer, and a missing scope gets a 403, the way your API will answer.

What passes is kept: a POST adds a record that the next GET returns, until you reset with POST /__mock/reset. What it answers →

Requests to RapiMock: a POST stores Biscuit, a GET lists it, a POST missing a required field gets 400, and a DELETE whose token lacks the pets:write scope gets 403
How It Works

It Reads the Data Model Off Your Spec

Paths that share a schema and a shape become one resource, with its key and what each operation does to it. Fields such as ownerId link resources, so seeded pets belong to seeded owners. Where nothing fits, the operation stays static and answers with the spec's example. How it works →

The /pets operations become the Pet resource with key id from {petId}; /owners/{ownerId} becomes Owner, which Pet links to by ownerId; POST /login stays static
Mock UI

See What the Mock Made of Your Spec

The spec check's Mock UI for the City Library example: 13 operations, 3 resources and 30 records, 22 lint warnings by category, and one operation that needs review

City Library, an example with a few gaps

  • What it found. 13 operations, 3 resources and 30 seeded records, read off the spec.
  • Lint. 22 warnings: responses without examples, parameters without descriptions, writes with no security.
  • Needs review. One operation where the spec left a gap and the mock had to guess, with the reason.
  • The same UI at /__mock/ui while rapidoc mock --stateful runs, with the records it holds now.

The spec check runs in your browser: your own spec is not sent anywhere. Paste it, drop the file, or give its address.

What You Get

More Than Canned Examples

Testing

Parallel Tests, Separate Data

Send an X-Mock-Session header and a test gets its own copy of the seed data, made when it first writes. Reset, read and load the data over HTTP, from tests in any language. Sessions →

test-1 adds Biscuit and test-2 deletes Rex, each in its own copy of the data, while the default data stays untouched
Two Mocks

In the Page or as a Server

<rapi-doc> also has a mock inside the browser, for docs and demos. They are built for different work.

In-browser mockRapiMock
RunsInside the pageAs an HTTP server
Who can call itThe page itself: Try, <rapi-flow>Anything: curl, your frontend, tests
Request validationNoYes
Token and scope checksNoYes
Remembers what you createNoYes, with --stateful
Best forDocs and demosDevelopment and testing

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.

Compare

How RapiMock Compares

RapiMock does one job: a mock that behaves like your API, from the spec alone, with its security and its data. Other tools do more in other places, such as recording traffic, other protocols or a hosted service, and the table says where.

RapiMock compared with Prism, WireMock, Mockoon, Postman mock servers and Microcks
CapabilityRapiMockMIT · open sourcePrismWireMockMockoonPostman mocksMicrocks
From the spec
Mock straight from the specPoint it at the spec; no stubs to write
OpenAPI 2.0, 3.0 and 3.1
In WireMock CloudStubs by hand in open source
Imported, partly mapped
Through a generated collection
Needs examples in the spec
Data from the schemasRealistic values where there is no example
Generated per fieldThe same on every run for a seed
Dynamic mode
Faker templates by hand
Once, at import
Faker variables by hand
Templates by hand
Request validationA bad request gets a 400 that says why
Parameters and bodies
Parameters and bodies
In WireMock Cloud
Not documented
Parameters only
Tokens and OAuth scopesChecked against your issuer and the spec's security
JWTs verified, scopes checked401 or 403 as the real API would
Missing credentials only
Header rules by hand
Header rules by hand
Not documented
Header pattern only
State and tests
State between requestsWhat you create, you can read, change and delete
On its roadmap
An extensionOr WireMock Cloud Enterprise
CRUD routes you set up
Handlers you write
Scripts you write
Separate data per testParallel tests do not see each other
No state
Not documented
Not documented
Not documented
Not documented
Control APIReset, read and set the data from any language
Admin API
Admin API
Not documented
No state reset
A UI to look insideIts records and what each operation does
In WireMock Cloud
Logs in the desktop app
Logs and state
Web console
Latency and faults
A delay, and error responses on requestNo connection faults
Delays and connection faults
Latency
Delays, errors, chaos mode
Delays
Beyond the spec
Record or proxy a real API
Proxy, no recording
Proxy, record and play back
Proxy and recording
Not documented
Proxy; HAR import
GraphQL, gRPC or AsyncAPI
GraphQL and gRPC extensions
gRPC
All three
MCP for AI agentsAgents call the mocked API as tools
rapidoc mcp serve, pointed at the mock
WireMock Cloud Enterprise
Starts and stops mocks only
Mocks as MCP tools
License and hosting
License
MITNo paid tier
Apache 2.0
Apache 2.0WireMock Cloud is commercial
MITPro and Enterprise are paid
ProprietaryWith a free plan
Apache 2.0
Hosted URL a team sharesA managed service, nothing to run
Run it on your own server
Stoplight platform
WireMock CloudFree tier with limits
Enterprise
On every plan
Self-hosted
Included, open sourcePartly, or by handNeeds a paid or hosted planNot offered
Other products as described in their own documentation on November 23, 2026. Sources

Products change. If a cell is out of date, open an issue with a link to the page that shows it, and we will fix the table.

Try It on Your Spec

The spec check shows what RapiMock makes of your spec, in your browser: the spec is not sent anywhere.