Closed Lajule closed 3 years ago
Might be due to JSON decoder setting UseNumber which unmarshals as a Number instead of float64.
When tableGet grabs data for the json number value its type is a json.Number
instead of a float64. Since json.Number isn't a case in the switch statement, it falls through and returns nil.
Ok but how I can get the value ?
@tobley that sounds pretty logical!!! I didn't think about that!
I'll try to add the proposed fix, thanks for the great pointer
;-) regards
This issue was marked as resolved a long time ago and now has been automatically locked as there has not been any recent activity after it. You can still open a new issue and reference this link.
Can not read integer from response with Lua you can not read an integer in a response with lua script
Your configuration file The content of your
krakend.json
. When using the flexible configuration option, the computed file can be generated usingFC_OUT=out.json
with contacts.lua:
http response:
but got "nil" in logs