Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static UI assets reference malformed when using sub apps #52

Open
dnwarnock opened this issue Jun 27, 2018 · 1 comment
Open

Static UI assets reference malformed when using sub apps #52

dnwarnock opened this issue Jun 27, 2018 · 1 comment

Comments

@dnwarnock
Copy link

Swagger UI static assets are set to

<link href="/doc/swagger_static/css/typography.css" media="screen" rel="stylesheet" type="text/css">

when they should actually live at

<link href="/api/v1/doc/swagger_static/css/typography.css" media="screen" rel="stylesheet" type="text/css">

if setup_swagger is called on a sub app like:

   setup_app(v1)
    setup_swagger(
        v1,
        swagger_url='/doc',
        swagger_from_file="v1_swagger.json",
        api_base_url='/api/v1'
    )
    app = web.Application()
    app.add_subapp('/api/v1', v1)

FIX:

setup_swagger should set statics_path = '{}{}/swagger_static'.format(api_base_url,_swagger_url) if sub apps are to work as specified in the documentation

@dnwarnock
Copy link
Author

Suggested fix: #53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant