Quickstart
You need Node.js 22.12 or later and an OpenAPI 3.0, 3.1 or 3.2 file.
1. Install
Section titled “1. Install”npm install -D @rapidoc/cli @rapidoc/mock2. Start it
Section titled “2. Start it”npx rapidoc mock openapi.yaml --statefulThe server listens on http://localhost:4010 and serves each API under its own path, named after the file: openapi.yaml is served at http://localhost:4010/openapi. It prints what it found:
• State: openapi: 3 resource(s), 30 record(s). Operations: 14 stateful, 2 needs review, 3 static• Mock UI: http://localhost:4010/__mock/ui3. Create something and read it back
Section titled “3. Create something and read it back”curl -X POST localhost:4010/openapi/pets -H "Content-Type: application/json" -d '{"name":"Biscuit"}'curl localhost:4010/openapi/petsThe second call lists the seeded pets and the one you created.
4. Look inside
Section titled “4. Look inside”Open http://localhost:4010/__mock/ui to see the records and what the mock does for each operation. See the Mock UI tour.
More than one spec
Section titled “More than one spec”npx rapidoc mock orders.yaml billing.yaml # /orders and /billingnpx rapidoc mock ./specs --port 4011 # every OpenAPI file in the foldernpx rapidoc mock # in a portal folder: the local specs under apis:When two files would get the same name, their parent folders are added until the names differ (billing-v1/openapi.yaml becomes /billing-v1-openapi). The mapping is printed at start, and GET / lists the APIs served.
Without state
Section titled “Without state”Leave out --stateful and every call is answered on its own, from examples or generated data. Request validation and token checks work the same. See What it answers.