Reads a key that is required to be present in json but whose value
may legitimately be null (OpenAPI 3.1 type: [T, "null"] combined
with required). A plain json[key] as T? cast would otherwise
accept a missing key as a null value, silently violating required.
Throws FormatException when the key is absent.
Runs build to construct a fromJson-parsed value of type T,
converting any TypeError (e.g. an unexpected null or a cast
failure on a required field) into a FormatException that names
the class and includes the offending JSON. Generated fromJson
factories delegate to this so callers that catch Exception
treat malformed bodies as a parse error, not a crash.