-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON bug #2426
Comments
I can reproduce with the following (simplified) workflow: JSON version of the workflow for testing: The issue lies with the serialization of the JavaScript object returned from the RunJavaScript activity. |
The problem is not the output of the first activity (which is an array of ExpandoObjects), but with |
Interestingly enough, Newtonsoft Json can properly serialize the expandos to JSON. Sample result: [
{
"Item": "e991f17a-246b-4d7d-a4b6-abbf54bd6911",
"Values": {
"ListItem": "Name",
"Value": "Test"
}
},
{
"Item": "e991f17a-246b-4d7d-a4b6-abbf54bd6911",
"Values": {
"ListItem": "E-mail",
"Value": "test@test.com"
}
}
] What I suggest we do is add a custom serialization JS function that we use instead of |
The following JS expression can now be used: return jsonEncode(activities.process.Output()); The result will look like this: [{"Item":"e991f17a-246b-4d7d-a4b6-abbf54bd6911","Values":{"ListItem":"Name","Value":"Test"}},{"Item":"e991f17a-246b-4d7d-a4b6-abbf54bd6911","Values":{"ListItem":"E-mail","Value":"test@test.com"}}] |
It works but with this solution you might want to interfere with |
Yeah maybe. But, barring whether it's even possible or not, I don't know that JSON stringify is actually broken. For all I know it's expected behavior when serializing Would be good if someone could do a little investigation and look at Jint's JSON stringify implementation. |
Tracking upstream: sebastienros/jint#995 |
The ExpandoObject serialization issue was fixed in sebastienros/jint#996. |
Problem:
JS activity called
process
Transfered data between the steps:
POST content (generation) of the HTTP activity
Received data at my endpoint
Note: Stringifying the JS object in the JS activity and then just using it in the HTTP activity (
return activities.process.Output();
) returns the correct JSON.The text was updated successfully, but these errors were encountered: