render openapi spec client-side

- move spec to _static/rest-api.yml, since the original yaml must be served
- copy javascript rendering code from FastAPI (uses swagger-ui)
- remove link to pet store, since there isn't a big enough difference to duplicate it
- remove bootprint rendering with node
This commit is contained in:
Min RK
2021-10-28 23:19:21 +02:00
parent 5c01370e6f
commit 468aa5e93c
14 changed files with 46 additions and 55 deletions

View File

@@ -9,7 +9,8 @@ import jupyterhub
from jupyterhub.scopes import scope_definitions
HERE = os.path.abspath(os.path.dirname(__file__))
PARENT = Path(HERE).parent.parent.absolute()
DOCS = Path(HERE).parent.parent.absolute()
REST_API_YAML = DOCS.joinpath("source", "_static", "rest-api.yml")
class ScopeTableGenerator:
@@ -99,7 +100,7 @@ class ScopeTableGenerator:
def write_api(self):
"""Generates the API description in markdown format and writes it into `rest-api.yml`"""
filename = f"{PARENT}/rest-api.yml"
filename = REST_API_YAML
yaml = YAML(typ='rt')
yaml.preserve_quotes = True
scope_dict = {}