encode / apistar

The Web API toolkit. 🛠
https://docs.apistar.com
BSD 3-Clause "New" or "Revised" License
5.57k stars 411 forks source link

static_url kwarg to apistar.docs is not enough #662

Open mivade opened 5 years ago

mivade commented 5 years ago

Following the instructions here I'm trying to create an endpoint in a Tornado app that shows the API documentation. I'm setting up a static file handler similar to this:

from pathlib import Path

import apistar
from tornado.web import StaticFileHandler

# ...

apistar_static_path = Path(apistar.__file__).parent.joinpath("themes", theme_name, "static")
handlers += [
    ("/apistar/(.*)", StaticFileHandler, {"path": str(apistar_static_path)})
]

# ...

This works fine if theme_name = "apistar" but there are several 404s with swaggerui and redoc themes due to missing JS/CSS files that are not included in apistar/themes. If these files aren't going to be included in the package, then there should be a way to specify a vendor URL prefix.