Skip to content

fhir-eswatini: errors come back with escaped JSON #1604

@josephjclark

Description

@josephjclark

When the fhir server returns an error from http.post, the response body has string encoded JSON.

I've truncated a response but it looks a bit like this:

{
  "body": "{\"resourceType\":\"OperationOutcome\",\"issue\":[{\"ext
  "duration": 695,
  "headers": {
    "connection": "keep-alive",
    "content-length": "22088",
    "content-type": "application/fhir+json; charset=utf-8",
    "date": "Fri, 20 Mar 2026 16:06:11 GMT",
    "keep-alive": "timeout=5",
    "vary": "Accept-Encoding",
    "x-openhim-transactionid": "69bd707380863bf16a1b4ff8"
  },
  "message": "POST to http://172.209.216.154:5001/fhir returned 422: Unprocessable Entity",
  "method": "POST",
  "statusCode": 422,
  "statusMessage": "Unprocessable Entity",
  "url": "http://172.209.216.154:5001/fhir"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions