You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Santiago Medina (Jira)" <ji...@apache.org> on 2026/04/23 22:43:00 UTC

[jira] [Created] (THRIFT-5953) Rust codegen should support forward-compatible deserialization for union fields in structs

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)