Open
Description
It would be nice if Pydantic automatically figured out the path of least cost to determine which item in a union we should pursue. Essentially we'd want to figure out the divergent points between two schemas and check those via a depth-first sort of validation instead of a breadth-first type validation that we currently do. Some obvious cases are:
- A literal field that diverges
- Fields that are only present in one model or some of the models
- Fields that have totally incompatible types
It does get tricky e.g. with a combination of these.