SIGN IN SIGN UP

fix(event_handler): normalize Union and RootModel sequences in body validation (#8067)

* handle Union and RootModel sequences in Body validation

* fix(event-handler): make sequence detection recursive for nested Union/RootModel

The original fix only checked one level deep. This makes
_is_or_contains_sequence recursive so it catches:
- Optional[RootModel[List[Model]]] (Union containing RootModel)
- RootModel[Union[Model, List[Model]]] (RootModel wrapping Union)

Adds 16 regression tests covering edge cases: Optional, empty list,
single-element list, pipe syntax, cross-resolver, large payloads, etc.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Leandro Damascena <lcdama@amazon.pt>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
D
Dan Johns committed
3137ecb31c5571296955243f2d0dec215f57360b
Parent: 2ab8f39
Committed by GitHub <noreply@github.com> on 3/26/2026, 2:09:01 PM