From 9207cf501c0220e5ce27025e05210ffe1736f4fa Mon Sep 17 00:00:00 2001 From: David Arena Date: Tue, 17 Dec 2024 22:25:09 +0100 Subject: [PATCH] fix: returned object --- freqtrade/rpc/api_server/api_schemas.py | 3 ++- freqtrade/rpc/api_server/api_v1.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/freqtrade/rpc/api_server/api_schemas.py b/freqtrade/rpc/api_server/api_schemas.py index 5d31c1d99..db7a312c5 100644 --- a/freqtrade/rpc/api_server/api_schemas.py +++ b/freqtrade/rpc/api_server/api_schemas.py @@ -619,4 +619,5 @@ class Health(BaseModel): bot_startup_ts: int | None = None class ListCustomData(BaseModel): - custom_data: list[dict[str, Any]] | None = None + trade_id: int + custom_data: list[dict[str, Any]] diff --git a/freqtrade/rpc/api_server/api_v1.py b/freqtrade/rpc/api_server/api_v1.py index 20acfe96f..086d3dce1 100644 --- a/freqtrade/rpc/api_server/api_v1.py +++ b/freqtrade/rpc/api_server/api_v1.py @@ -535,7 +535,7 @@ def sysinfo(): def health(rpc: RPC = Depends(get_rpc)): return rpc.health() -@router.get("/trades/{tradeid}/custom_data", response_model=ListCustomData, tags=["info"]) +@router.get("/trades/{tradeid}/custom-data", response_model=list[ListCustomData], tags=["info"]) def list_custom_data(trade_id: int, rpc: RPC = Depends(get_rpc)): custom_data = rpc._rpc_list_custom_data(trade_id) - return ListCustomData(custom_data=custom_data) + return custom_data