Skip to main content
Develop Tools
← Return to usage guide

API Mock Data Generator | Comprehensive Guide to Usage, Settings, and Troubleshooting

If the frontend waits for the backend to be completed, missing UI elements and response-structure mismatches will all be discovered during integration. Agree on contracts and scenarios first, then proceed with development using mock data in the same shape.

The flow for developing the Frontend first using API specifications and mock data instead of an unfinished Backend
The flow for developing the Frontend first using API specifications and mock data instead of an unfinished Backend

Generate dummy JSON for API responses

Generate mock data in the browser from JSON samples without confidential information by specifying field rules, count, Seed, and output format.

Conclusion: Use the API specification as the source of truth and create a mock response

Rather than defining Path or Status independently, extract Response Body types from the API specification and create normal, empty, and Error Fixtures. The Frontend handles Mocks and the live API through the same Interface, limiting switch points.

If the frontend develops an independent mock, its types, null handling, and pagination format may not match when the backend is complete. Synchronize contract changes with the mock.

Division of work before the backend is complete

DeliverableAssigneeconfirmation
API contractFrontend/backend collaborationType, required, Status
Mock JSONUse on the frontendMatches the contract
Request InterceptMSW, etc.Path, Method, Status
Production APIBackendPass the same Contract Test

Steps for implementing the frontend first

  • 1. Agree on success, empty, and error responses for each endpoint.
  • 2. Create one JSON example that contains no personal information.
  • 3. Generate the required number and save them as fixtures.
  • 4. Replace the data access layer with a mock and implement the UI.
  • 5. After the backend is complete, run contract tests and switch to the real API.

UI states to check first

Account to checkCases to prepareConfirmation details
LoadingConfigure delays on the MSW sideSkeleton and duplicate submission
SuccessNormal responseBasic display
EmptyEmpty array / zero itemsEmpty State
ErrorError body and statusRetry and guidance

DevelopTools does not set delays or HTTP status codes. Manage generated bodies separately from network mock settings such as MSW.

Make it easy to switch to the real API

Do not continue importing Fixtures directly into UI Components; replace Mocks at the Repository or Fetcher boundary. Sharing type definitions, OpenAPI, or JSON Schema as a contract makes differences easier to detect.

What the API mock data generator can and cannot do

ItemCurrent supportAdditional information
InputPasted JSON, .json files, and five types of presetsDirect input of OpenAPI / JSON Schema is not supported.
outputPagination JSON in single-object, array, and fixed formatsDoes not start HTTP endpoints or mock servers
Number of1 to 10,000 itemsThe number of array elements is 0–100. There is no output byte limit.
ValuesSequential numbers, UUIDs, names, email addresses, URLs, IP addresses, numbers, booleans, dates and times, enums, null, and moreInference from field names and sample values is heuristic
ReproducibilityRegenerate using the same settings as the string seed.Changing the generator implementation may change future values
LocaleJapanese and EnglishUse the built-in dictionary; do not load the Faker Library.
Edge Casenull probability, empty arrays, fixed values, and numeric rangesOccurrence probabilities for Optional fields and dedicated Boundary Scenarios are not supported.
SaveCopy and UTF-8 JSON downloadDo not send input or generated results to the server.

The generated content is JSON data that can be used for API responses. Configure MSW handlers that intercept requests, HTTP status, headers, delays, and endpoints themselves in a separate development environment.

Compare primary sources with the implementation

Specifications for Faker, MSW, Storybook, OpenAPI, and JSON Schema are updated. Do not permanently rely on examples in articles; check the version in use and official documentation. DevelopTools' generator does not embed Faker or MSW; it generates JSON using its own seeded random number generator and built-in dictionaries in the browser.

Example: Create a product list before the backend

Agree on the Product id, name, price, and stock, and prepare 20 normal items and an empty array.

Use a separate fixture for the error body and configure HTTP 500 in the MSW handler.

  1. Agree on the Response type
  2. Generate normal, empty, and Error cases
  3. Integrate into MSW, etc.
  4. Rerun the same UI test against the real API

Before integration, check response differences so the UI does not use properties that exist only in mocks.

Frequently asked questions

Do I also need a Mock Server?
Fixtures are sufficient when only passing Data to a simple Component. Combine them with MSW or similar when also testing actual fetch processing.
Can I leave a Mock in production?
Limit it to development/test use and separate the configuration so it cannot enter production bundles or switching conditions.