Error updating QueueItem via PUT request

Hi There,

I am struggling with updating the QueueItem after it fails, as i need to record some information when an Application Exception occurs. In this case the QueueItem is a compex nested JSON object which is created after deserialization and read back deserialized into a C# Class. It looks like when i try to update the QueueItem after an Application Exception, only simple Key-Value pairs are accepted (Assuming the type is a dictionary), but not the JSON with nested objects. Below are the 2 secnarios illustrated in a simplified format. Appreciate your inputs.

THIS WORKS

{
  "Name": "QueueName",
  "Priority": "High",
  "SpecificContent": {
    "Key": "Value",
    "Key": "Value",    
  }

THIS DOESN’T WORK

{
  "Name": "QueueName",
  "Priority": "High",
  "SpecificContent": { COMPLEX NESTED JSON }
  }

Thank you

From the viewpoint of serializations, it might be better to place the nested JSON as a serialized JSON as content

e.g. when:

"SpecificContent": {
        "additionalProp1": {"nestedProp2": "string","additionalProp3": "string"}

is failing

Then:

"SpecificContent": {"additionalProp1": "{\"nestedProp2\": \"string\",\"additionalProp3\": \"string\"}"},

should work at least

However, keep in mind of the risks, when using PUT for the Updates. Ensure that all important properties are included within the Put Payload and get not cleared, when ommited

1 Like

@ppr , thanks a lot. It worked :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.