Fix enable/reenable of swagger UI endpoint

This commit is contained in:
Matthias 2021-01-12 19:27:49 +01:00
parent ac43591c44
commit 47a06c6213
2 changed files with 2 additions and 3 deletions

View File

@ -266,7 +266,7 @@ whitelist
## OpenAPI interface
To enable the builtin openAPI interface, specify `"enable_openapi": true` in the api_server configuration.
To enable the builtin openAPI interface (Swagger UI), specify `"enable_openapi": true` in the api_server configuration.
This will enable the Swagger UI at the `/docs` endpoint. By default, that's running at http://localhost:8080/docs/ - but it'll depend on your settings.
## Advanced API usage using JWT tokens

View File

@ -30,8 +30,7 @@ class ApiServer(RPCHandler):
api_config = self._config['api_server']
self.app = FastAPI(title="Freqtrade API",
openapi_url='openapi.json' if api_config.get(
'enable_openapi', False) else None,
docs_url='/docs' if api_config.get('enable_openapi', False) else None,
redoc_url=None,
)
self.configure_app(self.app, self._config)