My response coming back from the DV endpoint is different to the order of key value pairs in my JSON templater, why is this? Is this expected? i.e we have no control?


My response coming back from the DV endpoint is different to the order of key value pairs in my JSON templater, why is this? Is this expected? i.e we have no control?


Best answer by zoe.forbes
Hi
As JSON objects are unordered, the differences between the output of the JSONTemplater and the DV response is expected. The top answer in this Stack Overflow thread goes into more detail on this, referencing the official JSON specification.
A potential workaround is to send the response with content-type set to text/plain, but this might not be suitable for your situation.
We’re considering preserving the order of JSON objects in future releases, but I can’t give a timescale for this at the moment.