Ghraven commented on PR #754: URL: https://github.com/apache/burr/pull/754#issuecomment-4484003428
You're absolutely right @elijahbenizzy — loosening to `object` is the wrong shape. `Union[A, B]` isn't a subtype of `A` or `B`, so what's actually needed is to accept union types in the annotation (e.g. `Union[Type[BaseModel], Type[dict], UnionType]`) and have the validator detect the type per-instance at runtime rather than treating the whole union as one model class. Happy to rework this PR along those lines — adding `UnionType` to the accepted annotations and updating `_validate_and_extract_signature_types_streaming()` (and the pydantic integration validator) to dispatch per-instance when a union is passed. Would that direction work for you? If you'd prefer to leave this one closed and have me open a fresh PR with the correct shape, just say the word. Thanks for the careful review! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
