Recipe · OpenAPI
Turn an OpenAPI spec into a live mock (and back)
You already have an OpenAPI contract from the backend team. Instead of waiting for the server, turn that contract into live endpoints serving realistic data — then export it back when you tweak the shape.
Import: contract → live endpoints
Paste an OpenAPI 3.1 JSON document and MockSmith reads its schemas, turning each object schema into a resource with typed fields. You get full CRUD endpoints serving realistic data, matching the shapes your code already expects.
Bounded import
Imports are capped at 512 KB of OpenAPI JSON — plenty for a real contract, and a guard against pathological documents. Trim unused paths if you hit the ceiling.
Export: mock → OpenAPI 3.1
Any project exports to a clean OpenAPI 3.1 document, with the mock's base URL set as the server. Drop it into your tooling:
- Swagger UI / Redoc — instant interactive docs for the mock.
- Postman / Insomnia — import the spec, get a ready collection.
- Client codegen — generate a typed SDK that points straight at the mock.
The round-trip workflow
Import
Bring in the backend's OpenAPI contract to bootstrap the project.
Adjust
Tweak field types and counts in the visual builder for more realistic data.
Export
Send the updated OpenAPI back to your tooling and teammates.
Free, every plan
OpenAPI import and export are available on the free plan — no Pro needed. It's the fastest bridge between a written contract and something you can actually call.
Frequently asked
Which OpenAPI version is supported?
OpenAPI 3.1, as JSON. The importer reads object schemas to build resources; the exporter emits a 3.1 document with your mock URL as the server.
Will import capture every detail of my spec?
It maps schemas to resources and fields — the shape your frontend reads. Auth flows, callbacks and exotic constructs aren't reproduced; the goal is callable data, not a 1:1 server.
Can I round-trip without losing my tweaks?
Your project is the source of truth. Edit it in the builder, then export — the OpenAPI reflects your current spec. Re-importing an old document would overwrite, so export, don't re-import, to share changes.
Stop waiting on the backend.
Forge your own mock API in two minutes. Free, up to two projects, no credit card.
Forge a free mockRead next
Comparison
A hosted json-server alternative (no install, real data)
json-server is great locally. When you need a shared URL, realistic data and relations without maintaining a db.json, a hosted mock is the better fit.
5 minRecipe · Relations
Mock an API with relations (foreign keys that hold)
Model users, posts and comments where every foreign key points to a record that actually exists — no dangling ids, no hand-wiring.
4 min