Azure / iot-edge-testing-utility

IoT Edge testing utility for developers to test, debug and troubleshoot IoT Edge modules.
MIT License
5 stars 8 forks source link

Error when sending JSON data #12

Closed yalaas closed 4 years ago

yalaas commented 4 years ago

iotedgehubdev, version 0.14.1 OS: Ubuntu 16.04

When I attempt to send a JSON payload to the module being debugged, I get the following error: { "error": "TypeError: \"string\" must be a string, Buffer, or ArrayBuffer" }

Repro steps:

  1. iotedgehubdev start -i 'input1'
  2. curl --header "Content-Type: application/json" --request POST --data '{"inputName": "input1","data":{"key":"val"}}' http://localhost:53000/api/v1/messages
  3. observe the error message

To work-around this, I had to covert the "data" JSON value to string by escaping the double qoutes: curl --header "Content-Type: application/json" --request POST --data '{"inputName": "input1","data":"{\"key\":\"val\"}"}' http://localhost:53000/api/v1/messages

Can the tool be modified to stringify the "data" value?

SLdragon commented 4 years ago

fixed and close

sharbt commented 4 years ago

@SLdragon Still VSCode plugin uses 0.14.1 where issue originated , is there way to upgrade to use the fix and which version?