Open michaelarnauts opened 6 years ago
Okay, after much debugging, I've found out that you can specify the type as you do with Java, this is just not documented behavior for Javascript. You need application/json
as second parameter to S()
for this to work.
So, this will not work:
S('true');
And this will work:
S('true', 'application/json');
There still is something strange going on:
S('"test"', 'application/json');
is still returning "test"
(with the quotes). I would expect that camunda-spin removes the quotes since it is part of the definition for json to indicate that it is a string?
It works! Thanks.
According to the docs, camunda-spin should recognize primitives like booleans:
A bit down it states that in Javascript, you don't need to specify that it is a json, but you can just use
S()
to do this.I'm using spin to parse the return value of a REST call in a camunda connector, this works fine if I return an object, but not when I return a primitive like a string or a boolean.
I get the following error:
Stacktrace: