If the given schema is of the required type, returns the schema.
If the given schema is of the required type, returns the schema. Otherwise if the given schema is a union, it will attempt to find the required type in the union. Finally, will throw.
Requires a UNION schema and will attempt to find a subschema that matches the default value type.
Requires a UNION schema and will attempt to find a subschema that matches the default value type. If one matches it will move that schema to the head, as required by the spec.
Requires a UNION schema and will move the null schema to the head if it exists.
Requires a UNION schema and will move the null schema to the head if it exists. Otherwise returns the UNION as is.