bug: fix the docs rest api reference url (#3775)

* bug: fix the docs rest api reference url

* revert openapi json changes

* remove last line on json files

* Add explanation about `servers` and remove `servers` parameter from FastAPI

* generate openapi schema without empty end line
This commit is contained in:
Bilge Yücel 2022-12-28 12:30:58 +03:00 committed by GitHub
parent 890e2bf0f5
commit 86ade4817e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View File

@ -4,6 +4,11 @@
"title": "Haystack REST API",
"version": "1.13.0rc0"
},
"servers": [
{
"url": "http://localhost:8000"
}
],
"paths": {
"/initialized": {
"get": {

View File

@ -4,6 +4,11 @@
"title": "Haystack REST API",
"version": "1.13.0rc0"
},
"servers": [
{
"url": "http://localhost:8000"
}
],
"paths": {
"/initialized": {
"get": {

View File

@ -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"}],
)