Santiago Medina created THRIFT-5953:
---------------------------------------
Summary: Rust codegen should support forward-compatible
deserialization for union fields in structs
Key: THRIFT-5953
URL: https://issues.apache.org/jira/browse/THRIFT-5953
Project: Thrift
Issue Type: Bug
Reporter: Santiago Medina
**Title**
Rust codegen should support forward-compatible deserialization for union fields
in structs
**Description**
When generated Rust code deserializes a struct containing a union-typed field,
it can fail if the incoming payload contains a union variant that is unknown to
the local IDL.
In the current behavior, the generated union deserializer skips unknown field
ids, but if no recognized union member is found it returns an error. That error
then propagates through the enclosing struct deserializer, causing the whole
struct read to fail.
For forward compatibility, this case should be handled the same way as an
absent optional field: the enclosing struct should deserialize successfully and
the union field should remain unset.
**Expected behavior**
- Deserializing a struct with a union-typed field should succeed when the wire
payload contains only unknown variants for that union
- The union field should remain unset
- Other protocol and transport errors should continue to propagate normally
--
This message was sent by Atlassian Jira
(v8.20.10#820010)