DevTools Hub

Search tools

Search for a developer tool

Development

OpenAPI Mock Generator

Generate realistic mock responses from an OpenAPI/Swagger document, exportable as MSW handlers.

pets
GET/pets
200A list of pets

What this tool does

Paste, upload, or load an example OpenAPI/Swagger document and get realistic mock response data for every endpoint — useful for building a frontend before the real API exists, or for writing tests that don't depend on a live backend. Browse mocks per endpoint, or export everything at once as a JSON file or as ready-to-use Mock Service Worker handlers.

How example values are generated

Exporting mocks

All mocks (.json) downloads every response across every endpoint as one file, keyed by method, path, and status — useful as a reference or for feeding into other tooling. MSW handlers (.js) generates a ready-to-import handlers.js file using MSW's http/HttpResponse API, with one handler per endpoint using its primary (first 2xx, or first available) response.

FAQ

Does this run an actual mock server?

No — everything here is static generated data and code you export and use in your own project (with MSW, json-server, or however you already mock APIs). Nothing is hosted.

My spec looks fine but the mocks seem off

Run it through the OpenAPI Validator first — a broken $ref or malformed response schema can produce an incomplete mock without showing up as a parse error.

Is my spec uploaded anywhere?

No — generation happens entirely in your browser. Nothing is sent to a server.

Related tools