You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Darius Jankauskas (Jira)" <ji...@apache.org> on 2020/08/24 20:33:00 UTC

[jira] [Commented] (THRIFT-5195) Swift enums (generated from Thrift unions) don't work

    [ https://issues.apache.org/jira/browse/THRIFT-5195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17183584#comment-17183584 ] 

Darius Jankauskas commented on THRIFT-5195:
-------------------------------------------

This was fixed and merged and working beautifully. Thank you so much!

> Swift enums (generated from Thrift unions) don't work
> -----------------------------------------------------
>
>                 Key: THRIFT-5195
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5195
>             Project: Thrift
>          Issue Type: Bug
>          Components: Swift - Library
>    Affects Versions: 0.14.0
>            Reporter: Darius Jankauskas
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> I have some service functions not working. The required argument it takes is a Swift enum with associated value. This was generated from a Thrift union with all optional fields. The problem is that the associated value never gets sent to the server, i.e. TStruct.write() never encounters the associated value. Deeper in the forEach() method the propName is found but returns null in 
> {code:swift}
> if let tval = unwrap(any: propValue) as? TSerializable, let id = Self.fieldIds[propName] {{code}
> I've never used reflection (the Mirror class) nor contributed here but am willing to try.
> If anyone has any ideas/suggestions how to fix this, please let me know.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)