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

Mitesh edited comment on THRIFT-2315 at 10/28/23 5:03 PM:
----------------------------------------------------------

Btw with thrift 0.18.1, for python thrift both `optional value` and `required 
value with default value` dont seem to work. The client gets a typeerror "takes 
N arguments, N-1 given" in both cases. Is this what others are seeing?


was (Author: masterddt):
Btw with thrift 0.18.1, for python thrift both `optional value` and `required 
value with default value` dont seem to work. Is this what others are seeing?

> Defaults applied to service method arguments not working as expected
> --------------------------------------------------------------------
>
>                 Key: THRIFT-2315
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2315
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (General)
>            Reporter: Jens Geyer
>            Priority: Major
>              Labels: default
>
> h3. Problem
> {code}
> service Foobar {
>   void Test( 1: i32 someValue = 42)
> }
> {code}
> The default of 42 is set into the Test_Args structure in most languages, but 
> later overwritten because the generated calls do completely ignore these 
> defaults. One has always to call:
> {code}
> client.Test( 1);
> client.Test( 42);
> client.Test( 4711);
> {code}
> instead of
> {code}
> client.Test( 1);
> client.Test( );  // 42 is the default
> client.Test( 4711);
> {code}
> h3. Applies to
> Most (all?) languages.
> h3. Todo
> Create a sub-task for your particular language and add the patch. :-)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to