The request has a payload like:
{"books": ["a", "b", "c"]} and I store it into the variable "myBooks" using an Extract Variables Policy
In node.js I use apigee-access to get the extracted variable:
var myNodeBooks = apigee.getVariable(req, 'myBooks');
console.log(myNodeBooks) gives what you'd expect:
["a","b","c"]
However, I can't operate on the variable at all.
myNodeBooks[0] breaks at runtime. So does myNodeBooks.split(","). If I send a request to BaaS with the variable, BaaS just ignores it.
My suspicion is it's a problem with the data type but I'm hoping someone with my experience could clarify.
Thanks.