You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Randy Abernethy (JIRA)" <ji...@apache.org> on 2014/08/19 13:21:20 UTC
[jira] [Resolved] (THRIFT-2064) Node thrift can't handle maps with
primitive values
[ https://issues.apache.org/jira/browse/THRIFT-2064?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Randy Abernethy resolved THRIFT-2064.
-------------------------------------
Resolution: Cannot Reproduce
Fix Version/s: 0.9.2
Assignee: Randy Abernethy
see comment above
> Node thrift can't handle maps with primitive values
> ---------------------------------------------------
>
> Key: THRIFT-2064
> URL: https://issues.apache.org/jira/browse/THRIFT-2064
> Project: Thrift
> Issue Type: Bug
> Components: Node.js - Library
> Affects Versions: 0.9
> Reporter: Sherban Drulea
> Assignee: Randy Abernethy
> Priority: Critical
> Labels: node, nodejs
> Fix For: 0.9.2
>
>
> When passing a map with primitive values (i.e. boolean or integer) via the thrift-npm, I get the following error:
> ERROR:Object false has no method 'copy'
> The error is from the many copy() calls in thrift-npm: thrift/lib/thrift/transport.js
> transport.js calls copy() on primitive thrift function parameters (i.e. int and boolean).
> Example IDL:
> struct SetTeamPrivilegesParams {
> 1: optional i32 teamId,
> 2: optional string platform,
> 3: optional string title,
> 4: optional map<string,bool> privileges
> }
> /**
> * Sets the bit offsets in the Key Archive index for the various privileges sent by the client.
> **/
> SetTeamPrivilegesResponse setTeamPrivileges(1: SetTeamPrivilegesParams params) throws (1: ServiceException ex)
> Example Client Code (vars in 'values' are all boolean):
> var updateTeamParams = new ttypes.UpdateTeamParams({
> teamId: teamId,
> platform: platform,
> title: title,
> values: { 'canEditEmblem': false,
> 'isBanned': true
> }
> });
> var argsArray = [updateTeamParams];
> try{
> tc.call( 'setTeamPrivileges', argsArray, restResponse );
> }
> catch(err){ console.log( "ERROR:" + err.message ) };
> ERROR:Object false has no method 'copy'
> Please fix transports.js to handle map parameters with primitives.
--
This message was sent by Atlassian JIRA
(v6.2#6252)