You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@thrift.apache.org by "anthonyalayo (via GitHub)" <gi...@apache.org> on 2023/02/19 10:56:32 UTC

[GitHub] [thrift] anthonyalayo commented on pull request #2741: Improve enum support for json generator

anthonyalayo commented on PR #2741:
URL: https://github.com/apache/thrift/pull/2741#issuecomment-1435955811

   @cwe-dixa is there a way I can use this in the javascript/typescript world? I currently have some serialized thrift strings, and I would like to deserialize them with their enums readable. 
   
   I tried the following:
   ```
   export function read(ThriftClass: any, buffer: Buffer): string {
     const client = new ThriftClass();
     const transport = new thrift.TFramedTransport(buffer);
     const protocol = new thrift.TCompactProtocol(transport);
   
     client.read(protocol);
   
     return client;
   ```
   
   But this causes all enums to be I32. Even though the types in the .d.ts files are there, the javascript doesn't do anything with them.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@thrift.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org