[logging] REST payloads are over-stringified and lose JSON structure #2276
Open
Description
In the current version of #2270, the httpResponse.payload
field is over-stringified: it's a single string with string-encoded JSON, rather than JSON object with the various fields. Since the response is coming back as JSON, we should ideally present that JSON, or at least recreate it from the response proto, without further stringifying it.
In other words, we're getting
"httpResponse": {
"payload": "{\n \"content\": \"The hail in Wales falls mainly on the snails.\",\n \"requestId\": \"some_value\",\n \"severity\": 0,\n \"otherRequestId\": \"\"\n}",
"status": 200,
// ...
}
whereas it would be more useful to get
"httpResponse": {
"payload": {
"content": "The hail in Wales falls mainly on the snails.",
"requestId": "some_value",
"severity": 0,
"otherRequestId": "",
},
"status": 200,
// ...
}