mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-07 18:14:10 +00:00
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:
@@ -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 = {}
|
||||
|
Reference in New Issue
Block a user