diff --git a/horizon/factdb/client.py b/horizon/factdb/client.py index 5b40620f..6b9e37c1 100644 --- a/horizon/factdb/client.py +++ b/horizon/factdb/client.py @@ -22,6 +22,7 @@ HttpFetcherConfig, HttpMethods, ) +from scalar_fastapi import get_scalar_api_reference from starlette import status from starlette.responses import JSONResponse @@ -51,6 +52,13 @@ def _init_fast_api_app(self) -> FastAPI: def _configure_api_routes(self, app: FastAPI): """mounts the api routes on the app object.""" + @app.get("/scalar", include_in_schema=False) + async def scalar_html(): + return get_scalar_api_reference( + openapi_url="/openapi.json", + title="Permit.io PDP API", + ) + authenticator = JWTAuthenticator(self.verifier) # Init api routers with required dependencies diff --git a/requirements.txt b/requirements.txt index 1f0e2027..23cf1d5b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,6 +10,7 @@ uvicorn[standard]>=0.17.6,<1 logzio-python-handler ddtrace sqlparse==0.5.0 +scalar-fastapi==1.0.3 httpx>=0.27.0,<1 protobuf>=3.20.2 # not directly required, pinned by Snyk to avoid a vulnerability opal-common==0.7.15