xcall icon indicating copy to clipboard operation
xcall copied to clipboard

Handle nested JSON objects in x-success callback

Open swinton opened this issue 2 years ago • 1 comments

Potential fix for https://github.com/martinfinke/xcall/issues/8.

When an x-callback-url scheme returns nested JSON objects, this should correctly deserialize and serialize as JSON.

E.g. to test with Bear's /todo action:

./xcall -url "bear://x-callback-url/todo?search=Manage%20todos%20with%20Bear%20and%20Alfred&token=$BEAR_TOKEN"

This returns the following JSON object:

{
  "notes": [
    {
      "creationDate": "2022-01-13T20:51:40Z",
      "tags": "[\"2022\",\"todo\",\"2022\\/01\",\"2022\\/01\\/13\"]",
      "title": "#todo Manage todos with Bear and Alfred",
      "modificationDate": "2022-01-19T04:00:06Z",
      "identifier": "65E26BBC-FB7E-46BF-BA5A-CF00E53B9784-42634-00025251E8230FF8",
      "pin": "no"
    }
  ]
}
(Note the tags property isn't correctly handled, I confirmed with the Bear support folks this is due to a limitation with the JSON serializer they are using 😸).

Closes #8.

swinton avatar Jan 24 '22 05:01 swinton

How can I build a version of xcall with this fix, by hand? or is there better way.

thanks

kimaldis avatar Mar 19 '24 19:03 kimaldis