hapifhir / hapi-fhir-jpaserver-starter

Apache License 2.0
356 stars 977 forks source link

HAPI JPA expects a FHIR payload in notification response #677

Closed parneshraniga closed 2 months ago

parneshraniga commented 2 months ago

I am currently moving a prototype from R4 to R5. This uses the latest JPA starter server and uses Subscriptions.

Subscriptions and notifications are working. My rest-hook returns a 200 status only with no payload but it seems that HAPI is expecting a FHIR payload. I can't find any documentation suggesting a FHIR payload is required in the response to the event notification in the FHIR specs.

This is the error I get when I send through an empty JSON response.

ca.uhn.fhir.rest.client.exceptions.FhirClientConnectionException: HAPI-1359: Failed to parse response from server when performing POST to URL http://localhost:5555/subs/task - ca.uhn.fhir.parser.DataFormatException: HAPI-1838: Invalid JSON content detected, missing required element: 'resourceType'

parneshraniga commented 2 months ago

My mistake. To be correct as per HTTP spec, I should have returned a 204 status code if there was no body. Works as expected with 204 code.