API call workflows/details no valid JSON when workflowid is string

Here you can submit bugreports
Post Reply
emcodem
Posts: 1811
Joined: Wed Sep 19, 2018 8:11 am

API call workflows/details no valid JSON when workflowid is string

Post by emcodem »

Hey Steinar,

it can happen that a workflow id is a string instead of an int (in my case it happened when importing the wf that was published here in the workflow respository thread).

In that case, the returned JSON from this Api method is not a valid json so any json parser throws an error.
Possibly you could just quote all returned values, not just only strings for safety

http://desktop-uifqt86:65445/api/json/v ... ws/details

ffastrans_api_error.png
ffastrans_api_error.png (53.81 KiB) Viewed 4521 times
emcodem, wrapping since 2009 you got the rhyme?
admin
Site Admin
Posts: 1687
Joined: Sat Feb 08, 2014 10:39 pm

Re: API call workflows/details no valid JSON when workflowid is string

Post by admin »

The "wf_id" should never be a sting with other letters than 0-9 so why you got one must be due to a bug. I have a total of 200 workflows and this has never happened. Anyway, I agree with you, the wf_id should always be reported as a string and I will take a look at that. Also, in the future the workflow ids might change to GUID-types which are strings. So, thank you for reporting and I will see if there might be a glitch somewhere, unless the .ini for that particular workflow somehow was manipulated before exporting.

-steinar
Post Reply