(20241224) GET request array fixed.

This commit is contained in:
2024-12-24 14:59:16 +05:30
parent b86dbe20ab
commit 0af9401feb
@@ -173,12 +173,15 @@ class TradingSymbolListRequestData(BaseModel):
@field_validator("exchanges", mode = "before") @field_validator("exchanges", mode = "before")
def ensure_list(cls, value): def ensure_list(cls, value):
_exchg = []
if isinstance(value, str): if isinstance(value, str):
if regex.match(text = value, pattern = r"\[.*\]"): _exchg = json.from_string(value) if regex.match(
else: _exchg.append(value) text = value,
elif isinstance(value, list): pattern = r"\[.*\]",
_exchg = value dot_all = True
): value = json.from_string(value)
else: value = [value]
elif isinstance(value, list): pass
else: value = None
return value return value