(20241224) GET request array fixed.
This commit is contained in:
@@ -173,12 +173,15 @@ class TradingSymbolListRequestData(BaseModel):
|
||||
|
||||
@field_validator("exchanges", mode = "before")
|
||||
def ensure_list(cls, value):
|
||||
_exchg = []
|
||||
if isinstance(value, str):
|
||||
if regex.match(text = value, pattern = r"\[.*\]"): _exchg = json.from_string(value)
|
||||
else: _exchg.append(value)
|
||||
elif isinstance(value, list):
|
||||
_exchg = value
|
||||
if regex.match(
|
||||
text = value,
|
||||
pattern = r"\[.*\]",
|
||||
dot_all = True
|
||||
): value = json.from_string(value)
|
||||
else: value = [value]
|
||||
elif isinstance(value, list): pass
|
||||
else: value = None
|
||||
return value
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user