diff --git a/docs/_src/api/openapi/openapi-1.13.0rc0.json b/docs/_src/api/openapi/openapi-1.13.0rc0.json index a065a085c..4287bc0ac 100644 --- a/docs/_src/api/openapi/openapi-1.13.0rc0.json +++ b/docs/_src/api/openapi/openapi-1.13.0rc0.json @@ -4,6 +4,11 @@ "title": "Haystack REST API", "version": "1.13.0rc0" }, + "servers": [ + { + "url": "http://localhost:8000" + } + ], "paths": { "/initialized": { "get": { diff --git a/docs/_src/api/openapi/openapi.json b/docs/_src/api/openapi/openapi.json index a065a085c..4287bc0ac 100644 --- a/docs/_src/api/openapi/openapi.json +++ b/docs/_src/api/openapi/openapi.json @@ -4,6 +4,11 @@ "title": "Haystack REST API", "version": "1.13.0rc0" }, + "servers": [ + { + "url": "http://localhost:8000" + } + ], "paths": { "/initialized": { "get": { diff --git a/rest_api/rest_api/utils.py b/rest_api/rest_api/utils.py index 174913b5f..d5c566fa6 100644 --- a/rest_api/rest_api/utils.py +++ b/rest_api/rest_api/utils.py @@ -64,8 +64,11 @@ def get_openapi_specs() -> dict: """ Used to autogenerate OpenAPI specs file to use in the documentation. - See `docs/_src/api/openapi/generate_openapi_specs.py` + Returns `servers` to specify base URL for OpenAPI Playground (see https://swagger.io/docs/specification/api-host-and-base-path/) + + See `.github/utils/generate_openapi_specs.py` """ + app = get_app() return get_openapi( title=app.title, @@ -73,4 +76,5 @@ def get_openapi_specs() -> dict: openapi_version=app.openapi_version, description=app.description, routes=app.routes, + servers=[{"url": "http://localhost:8000"}], )