-
Notifications
You must be signed in to change notification settings - Fork 3
not automatically converting Logic App action input/output to json #69
base: master
Are you sure you want to change the base?
not automatically converting Logic App action input/output to json #69
Conversation
I see the tests are failing, before updating them could you give me some feedback on this one? Are there better options to treat the action input/output content or is this indeed the way to go? |
We'll have to check with @mbraekman since he has the most expirence with using the testing framework in the wild. |
First thought: isn't the in-/output of a Logic App action always json-format? One of the fields within the in-/output could be containing a different format (base64/xml/...), but other than that it's supposed to be json, no? If not, I might have missed some type of scenario, so could you give an example of where this differs? |
In this specific scenario we are using the compose action to show xml content (the reason for this is another matter). The action is defined as below: "Track_BaseLoadEnvelope": {
"inputs": "@xml(base64ToBinary(body('Transform_CDMMessageBundle_To_BaseLoadEnvelope')?['Content']))",
"runAfter": {
"Transform_CDMMessageBundle_To_BaseLoadEnvelope": [
"Succeeded"
]
},
"trackedProperties": {
"Content-Type": "application/xml"
},
"type": "Compose"
}, When you check on a similar action the input/output in the Logic App designer it will show a json. YET, when checking the on the Azure Management API the 'Workflow Run Actions - List' API endpoint (the one leveraged by this framework) the output url returns xml format. This (designer vs API) is probably how the perception got created that the input/output is always json. I did do a doublecheck and calling the output url form postman shows that a content-type header is returned set to 'application/xml'. I do think that this is because of the My suggestion; leverage 'string' from now as return value as an obvious bugfix and create (if desired) a separate feature request for more intelligent content handling. Let me know your thoughts so I can start having a look at adopting the tests if that's considered the way to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do this, then you have to provide an integration test to ensure it works by the least if you ask me.
I'm reluctant to move to something else than JSON but if it is what it is, why not 🤷♂️ But it should be backed by tests at least.
+1 on the integration test-remark from Tom. Also +1 on the intelligent content-handling. Can be as simple as: Although the use of this Fx is currently rather limited, we need to ensure we don't break the logic anyone might have implemented, so could this check (for json at least) already be included? |
What's the status on this @MichielVanwelsenaere ? |
haven't found the time yet... 😐 |
This PR changes the way Logic App input/output content is treated.
Instead of automatically converting it to json -which gives exceptions when the content is not in the json format- it is treated as a string
Closes #62