I need to send PATCH request with the following JSON data:
${jsonString}  Set Variable  [{"alias":"EMAIL_ORDER_CONFIRMATION","templateId":"${templateId}"}]
${resp}=  Patch Request   httpbin    /templates   data=${jsonString}    headers=${headers}
But when I run the test I am getting error message: [ ERROR ] Parsing of dictionary [{"alias":"EMAIL_ORDER_CONFIRMATION","templateId":"12345678-1111-1111-1111-11111111"}] failed. | FAIL | java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 3 path $[0]
As I understood the problem is that my JSON file contains [], but I need to handle this some how. I am using HttpRequestLibrary, because our project is Java based and I can't use python based robot libraries.
Only one solution what I found is using files=${files} instead data=${jsonString}:
${data}=  Get Binary File  ${CURDIR}${/}..${/}resources${/}${jsonImportFile}
${files}  Create Dictionary  file   ${data}
${resp}=  Patch Request   httpbin    /templates   files=${files}    headers=${headers}
didn't help, body is empty with this approach and I am getting PayLoad validation error.
Does anybody had this problem? If so please help how to deal with this type of JSON file
