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:
Monte Hoover
2026-07-20 18:05:24 -04:00
committed by GitHub
parent 5e13e3add4
commit 8329f7758c
5 changed files with 26 additions and 12 deletions

View File

@@ -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