Skip to content

Static UI assets reference malformed when using sub apps #52

@dnwarnock

Description

@dnwarnock

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions