You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When reading a Binary that contains a FHIR resource and setting the Accept header to the value of Binary.contentType, HAPI returns the contained resource instead of the Binary resource. It should return the Binary resource instead of extracting the contained resource.
To Reproduce
An example with the following Binary resource, containing a JSON Patient resource, created on https://hapi.fhir.org/baseR4/ (running HAPI FHIR 7.7.15-SNAPSHOT):
When requesting the resource with the XML MIME type, it returns the BInary instead:
GET /baseR4/Binary/45848035 HTTP/1.1Accept: application/fhir+xmlHTTP/1.1 200 OKContent-Type: application/fhir+xml;charset=utf-8<Binary xmlns="http://hl7.org/fhir"><contentType value="application/fhir+json"/><data value="..."/></Binary>
Expected behavior
In both cases, the server shall return the Binary resource, as specified in the FHIR specification:
When a read request is made with a FHIR type in the Accept header (e.g. "application/fhir+xml" or "application/fhir+json") the Binary resource is returned in the requested FHIR format. This applies even when the binary data itself has a FHIR mime type
It seems HAPI checks whether the requested MIME type is the same as the Binary.contentType before processing the special case with "application/fhir+xml" and "application/fhir+json".
Environment (please complete the following information):
Additional context
I checked the behaviour when no Accept header is specified; in that case, the contained resource is returned. While that case is not explicitly described in the spec, it seems coherent with the stated intent:
However, the intent is that unless specifically requested, the FHIR XML/JSON representation is not returned
The text was updated successfully, but these errors were encountered:
Describe the bug
When reading a Binary that contains a FHIR resource and setting the Accept header to the value of
Binary.contentType
, HAPI returns the contained resource instead of the Binary resource. It should return the Binary resource instead of extracting the contained resource.To Reproduce
An example with the following Binary resource, containing a JSON Patient resource, created on https://hapi.fhir.org/baseR4/ (running HAPI FHIR 7.7.15-SNAPSHOT):
When reading the resource with
Accept: application/fhir+json
, the server returns the contained resource (Patient):When requesting the resource with the XML MIME type, it returns the BInary instead:
Expected behavior
In both cases, the server shall return the Binary resource, as specified in the FHIR specification:
It seems HAPI checks whether the requested MIME type is the same as the
Binary.contentType
before processing the special case with "application/fhir+xml" and "application/fhir+json".Environment (please complete the following information):
Additional context
I checked the behaviour when no Accept header is specified; in that case, the contained resource is returned. While that case is not explicitly described in the spec, it seems coherent with the stated intent:
The text was updated successfully, but these errors were encountered: