Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.13.0
-
None
-
Patch Available
-
Patch
Description
Add missing default argument values for service client functions in generated Lua code.
Example Thrift definition:
const string kTestStr = "0"
service SomeService {
void someMethod(1: string a, 2: string b = kTestStr)
throws (1: SomeError error)
}
Generated code before:
function SomeServiceClient:send_someMethod(a, b)
self.oprot:writeMessageBegin('someMethod', TMessageType.CALL, self._seqid)
local args = someMethod_args:new
args.a = a
args.b = b
args:write(self.oprot)
self.oprot:writeMessageEnd()
self.oprot.trans:flush()
end
Generated code after:
function SomeServiceClient:send_someMethod(a, b)
self.oprot:writeMessageBegin('someMethod', TMessageType.CALL, self._seqid)
local args = someMethod_args:new
args.a = a
if b ~= nil then
args.b = b
else
args.b = '0'
end
args:write(self.oprot)
self.oprot:writeMessageEnd()
self.oprot.trans:flush()
end
Attachments
Issue Links
- links to