Flask-AppBuilder icon indicating copy to clipboard operation
Flask-AppBuilder copied to clipboard

Invalid URLs for OpenApi + SwaggerView with relativ url root

Open lnnwvr opened this issue 4 years ago • 2 comments

Flask-Appbuilder version: 3.0.1

When using openapi and swagger view with a relativ url root (e.g. localhost/foo/bar/api/v1) urls are not correct. A possible fix could be the following:

in api/manager.py

 servers=[{"url": url_for("OpenApi.get", version=version)[:-9]}],
 openapi_uri=url_for(OpenApi.__name__ + "." + OpenApi.get.__name__, version=version),

lnnwvr avatar Aug 19 '20 13:08 lnnwvr

Good point, can you make a PR?

dpgaspar avatar Aug 24 '20 12:08 dpgaspar

Not fixed yet ((. For personal purposes i made a workaroud at one time... Might be useful to someone. https://github.com/lexisstv/fab_addon_SwaggerTemporaryFix

lexisstv avatar Jun 16 '22 14:06 lexisstv