diff --git a/openapi.yaml b/openapi.yaml index 0ab2e0c..1bb0267 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -256,7 +256,5 @@ paths: summary: health tags: - AccessRequests -servers: -- url: / tags: - name: AccessRequests diff --git a/scripts/script_utils/fastapi_app_location.py b/scripts/script_utils/fastapi_app_location.py index d111392..48b4ee8 100644 --- a/scripts/script_utils/fastapi_app_location.py +++ b/scripts/script_utils/fastapi_app_location.py @@ -23,9 +23,6 @@ from ars.adapters.inbound.fastapi_.configure import get_openapi_schema from ars.adapters.inbound.fastapi_.routes import router -from ars.config import Config - -CONFIG = Config() # type: ignore app = FastAPI() app.include_router(router) @@ -35,7 +32,7 @@ def custom_openapi() -> dict[str, Any]: """Generate a custom OpenAPI schema for the service.""" if app.openapi_schema: return app.openapi_schema - openapi_schema = get_openapi_schema(app, config=CONFIG) + openapi_schema = get_openapi_schema(app) app.openapi_schema = openapi_schema return app.openapi_schema diff --git a/src/ars/adapters/inbound/fastapi_/configure.py b/src/ars/adapters/inbound/fastapi_/configure.py index 3b52521..6f9450f 100644 --- a/src/ars/adapters/inbound/fastapi_/configure.py +++ b/src/ars/adapters/inbound/fastapi_/configure.py @@ -24,25 +24,18 @@ from ars.adapters.inbound.fastapi_.routes import router -class DrsApiConfig(ApiConfigBase): - """Configuration parameters for the DRS API.""" - - api_route: str = "/ga4gh/drs/v1" - - -def get_openapi_schema(app: FastAPI, *, config: DrsApiConfig) -> dict[str, Any]: +def get_openapi_schema(app: FastAPI) -> dict[str, Any]: """Generates a custom openapi schema for the service""" return get_openapi( title="Access Request Service", version=__version__, description="A service managing access requests for the GHGA Data Portal", - servers=[{"url": config.api_root_path}], tags=[{"name": "AccessRequests"}], routes=app.routes, ) -def get_configured_app(*, config: DrsApiConfig) -> FastAPI: +def get_configured_app(*, config: ApiConfigBase) -> FastAPI: """Create and configure a REST API application.""" app = FastAPI() app.include_router(router) @@ -51,7 +44,7 @@ def get_configured_app(*, config: DrsApiConfig) -> FastAPI: def custom_openapi(): if app.openapi_schema: return app.openapi_schema - openapi_schema = get_openapi_schema(app, config=config) + openapi_schema = get_openapi_schema(app) app.openapi_schema = openapi_schema return app.openapi_schema