Follow up from T362108: Implement JSON schema validation in ArrayDef
validate() supports a third parameter that sounds like it would help with our use case. It's a bit field with flags than can be combined. Here are a few that sound useful:
Constraint::CHECK_MODE_TYPE_CAST Enable fuzzy type checking for associative arrays and objects
Constraint::CHECK_MODE_APPLY_DEFAULTS Apply default values from the schema if not set
**CHECK_MODE_TYPE_CAST is already implemented