mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-01 23:12:21 +00:00
Update the record-vs-envelope heuristic in the payload processing code to not treat a record that happens to have a list datatype as an entire envelope. (#7598)
This commit is contained in:
@@ -303,9 +303,11 @@ def _envelope_inner_schema(
|
||||
array_keys = [
|
||||
k for k, v in props.items() if isinstance(v, dict) and v.get("type") == "array"
|
||||
]
|
||||
# Only resolve as an envelope if there is exactly one list of all dicts,
|
||||
# or if the list is the only element present.
|
||||
if len(array_keys) == 1:
|
||||
items = props[array_keys[0]].get("items")
|
||||
if isinstance(items, dict):
|
||||
if isinstance(items, dict) and not _is_scalar_schema(items):
|
||||
return cast(dict[str, Any], items)
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user