Implementing Simple Mock Response Data
To add a simple mock response:
- Go to the Mock app Details Page for a running Mock app.
- Click the Implementation tab.
- Click the response card in the Simple Mock Responses section.
- Add the mock response using the following options:
- If no response data is defined, enter the response data and click Save.Note: The added response mock data does not affect the API specification.
- If a reference response schema is defined, click Generate response from schema to generate the response data based on the defined schema. Click Save.Note: If the defined response schema is
String
, the Generate response from schema link is not displayed. - If a response example is defined, click Revert to example from spec to use the defined response example. Click Save.
- If no response data is defined, enter the response data and click Save.
- Click Update Mock app to redeploy the Mock app. You are directed back to the Apps page.
After deploying the Mock app, you can test the app against the mock data. For more details, see Testing an API Mock App.