Skip to content

POST with non-Parameters resourceType crashes server #80

@jmandel

Description

@jmandel

Bug

Posting a valid FHIR resource that isn't a Parameters resource (e.g. Patient) causes a 500 crash. The server doesn't check resourceType before extracting operation parameters.

Repro

curl -s -X POST 'https://tx-dev.fhir.org/r4/CodeSystem/$validate-code' \
  -H 'Content-Type: application/fhir+json' \
  -H 'Accept: application/fhir+json' \
  -d '{"resourceType": "Patient", "id": "1"}'

Expected: HTTP 400 — "Expected Parameters resource, got Patient"
Actual: HTTP 500 — NPE on null.coding

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiThe issue relates to the API / http functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions