cancel
Showing results for 
Search instead for 
Did you mean: 

Return dummy response data when using the: 'try it out' feature

SOLVED
Occasional 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,

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator

Re: Return dummy response data when using the: 'try it out' feature

You need a mock server.

 

SwaggerHub supports OpenAPI mocking:

https://app.swaggerhub.com/help/integrations/api-auto-mocking


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

2 REPLIES 2
Moderator

Re: Return dummy response data when using the: 'try it out' feature

You need a mock server.

 

SwaggerHub supports OpenAPI mocking:

https://app.swaggerhub.com/help/integrations/api-auto-mocking


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

Occasional Contributor

Re: Return dummy response data when using the: 'try it out' feature

Thanks Helen

New Here?
Join us and watch the welcome video:
Announcements