From 47a06c6213e9b885551dd9b35711dcf5fb77b90e Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 12 Jan 2021 19:27:49 +0100 Subject: [PATCH] Fix enable/reenable of swagger UI endpoint --- docs/rest-api.md | 2 +- freqtrade/rpc/api_server/webserver.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/rest-api.md b/docs/rest-api.md index a013bf358..2c7142c61 100644 --- a/docs/rest-api.md +++ b/docs/rest-api.md @@ -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 diff --git a/freqtrade/rpc/api_server/webserver.py b/freqtrade/rpc/api_server/webserver.py index 97dfa444d..9c0779274 100644 --- a/freqtrade/rpc/api_server/webserver.py +++ b/freqtrade/rpc/api_server/webserver.py @@ -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)