You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Perhaps this is too obvious for most, but I struggled a bit figuring out how to use the result of my apispec to actually serve a Swagger UI from my Flask app.
I think other noobs might benefit if the documentation laid out clear steps on how to serve a Swagger UI, for example using Flask. I finally figured this out from this blog post here after a few hours of researching different solutions.
Beginners might waste a lot of time researching third party tools to do this simple task of serving the Swagger UI, when they are not required.
E.g, create a route that serves the base static html file from Swagger here. The css/js/image files could also be served from flask, or to make it simple in the documentation they could be linked to someone's hosted files. Line 42 of this file should look something like this:
url: "{{ url_for('serve_swagger_spec') }}",
And the route for this serve_swagger_spec can be created like so:
Perhaps this is too obvious for most, but I struggled a bit figuring out how to use the result of my apispec to actually serve a Swagger UI from my Flask app.
I think other noobs might benefit if the documentation laid out clear steps on how to serve a Swagger UI, for example using Flask. I finally figured this out from this blog post here after a few hours of researching different solutions.
Beginners might waste a lot of time researching third party tools to do this simple task of serving the Swagger UI, when they are not required.
E.g, create a route that serves the base static html file from Swagger here. The css/js/image files could also be served from flask, or to make it simple in the documentation they could be linked to someone's hosted files. Line 42 of this file should look something like this:
And the route for this
serve_swagger_spec
can be created like so:The text was updated successfully, but these errors were encountered: