Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
0.2
-
None
-
None
Description
The validate() method on generated structs verifies that required fields are set after validation. However, if the type of the field is a Union struct, then just checking that the field isn't null is not a valid check. The value may be a non-null union, but have an unset field. (We encountered this when deserializing a type that had a union for a field, and the union's set value was an enum value that had been removed from the definition, making it a skip.)
In order to perform the correct validation, if the value is a Union, then we must also check that the set field and value are non-null.