|
|
@ -17,6 +17,7 @@ from tildes.resources.user import user_by_username |
|
|
|
|
|
|
|
|
|
|
|
OPENAPI_YAML_FILE = "/opt/tildes/openapi_beta.yaml" |
|
|
|
SWAGGER_UI_HTML_FILE = "/opt/tildes/static/swagger-ui-tildes/index.html" |
|
|
|
|
|
|
|
|
|
|
|
def includeme(config: Configurator) -> None: |
|
|
@ -134,7 +135,9 @@ def includeme(config: Configurator) -> None: |
|
|
|
# Routes for the JSON API |
|
|
|
# We also provide a path for the full spec and the built-in swagger UI explorer |
|
|
|
config.pyramid_openapi3_spec(OPENAPI_YAML_FILE, route="/api/beta/openapi.yaml") |
|
|
|
config.pyramid_openapi3_add_explorer(route="/api/beta/ui") |
|
|
|
config.pyramid_openapi3_add_explorer( |
|
|
|
route="/api/beta/ui", template=SWAGGER_UI_HTML_FILE |
|
|
|
) |
|
|
|
|
|
|
|
with config.route_prefix_context("/api/beta"): |
|
|
|
config.add_route("apibeta.topics", "/topics") |
|
|
|