1cookie
4 years agoOccasional Contributor
Return dummy response data when using the: 'try it out' feature
hi,
I'm using the Swagger Standalone bundle:-
window.onload = function () {
const ui = SwaggerUIBundle({})
}
Rather than returning live data from an API endpoint and database - can I return some dummy data back for a user of my swagger document? This could be in the form of a flat json file or something similar.
Thanks,
You need a mock server.
SwaggerHub supports OpenAPI mocking:
https://app.swaggerhub.com/help/integrations/api-auto-mocking