JSON

Build a reusable JSON fixture library for an API

Save empty, successful, and error responses as named snippets, then export the fixtures you want to reuse or share.

Open Snippets Manager

Choose one fixture for each client state

A customer search screen needs at least three states to test. An empty result should show a helpful message, one match should render a row, and a failed request should let the user retry. Give each fixture a searchable name that includes the same endpoint or feature name.

These examples use fictional data. Keep HTTP status codes in your test instructions or snippet descriptions because the JSON body alone never sets the HTTP status.

Import the three named snippets

Open Snippets Manager, choose Import Library, and paste this array as JSON. Review the preview and confirm the import. Search for Customers and check that the three names appear. Open the single match and verify that its identifier is stored as text.

[
  {"title":"Customers - empty","data":{"items":[]}},
  {"title":"Customers - single match","data":{"items":[{"id":"demo-01","name":"Example Customer"}]}},
  {"title":"Customers - unavailable","data":{"error":"temporarily_unavailable"}}
]

Export just the fixtures you intend to share

Select the imported records, choose Export Selected, and open the downloaded file to check that it contains the three intended snippets. Because saved snippets live in this browser, keep the exported file with your project or share it with a teammate. Import adds records to the library, so repeated imports can create duplicates.

Further reading

Browse all guides · Suggest a correction