Summary
A FHIR instance read (GET /{type}/{id}) ignores Accept: application/fhir+xml and returns JSON, even though the server does serve XML — a search (?url=…) for the same resource correctly returns XML. So content negotiation is honored on search but silently dropped on instance reads.
Repro (live)
# instance read — asks for XML, gets JSON
curl -s -o /dev/null -w 'instance -> %{http_code} %{content_type}\n' \
-H 'Accept: application/fhir+xml' 'https://tx.fhir.org/r4/CodeSystem/v3-ActCode'
# => 200 application/fhir+json (BUG)
# search — asks for XML, gets XML
curl -s -o /dev/null -w 'search -> %{http_code} %{content_type}\n' \
-H 'Accept: application/fhir+xml' 'https://tx.fhir.org/r4/CodeSystem?url=http://terminology.hl7.org/CodeSystem/v3-ActCode'
# => 200 application/fhir+xml (correct)
(Same on ConceptMap/{id}. ValueSet/$expand and the search paths honor XML; instance reads do not.)
Expected
Per http.html content negotiation, the server SHALL return the requested representation (or 406 Not Acceptable if it cannot) — not silently switch to JSON. Since search already returns XML, instance reads should too.
Confirmed live against https://tx.fhir.org on 2026-06-06 (software FHIRsmith 0.9.6). Source line refs are from the published main branch.
Summary
A FHIR instance read (
GET /{type}/{id}) ignoresAccept: application/fhir+xmland returns JSON, even though the server does serve XML — a search (?url=…) for the same resource correctly returns XML. So content negotiation is honored on search but silently dropped on instance reads.Repro (live)
(Same on
ConceptMap/{id}. ValueSet/$expand and the search paths honor XML; instance reads do not.)Expected
Per http.html content negotiation, the server SHALL return the requested representation (or
406 Not Acceptableif it cannot) — not silently switch to JSON. Since search already returns XML, instance reads should too.Confirmed live against
https://tx.fhir.orgon 2026-06-06 (softwareFHIRsmith 0.9.6). Source line refs are from the publishedmainbranch.