hapifhir / hapi-fhir

🔥 HAPI FHIR - Java API for HL7 FHIR Clients and Servers
http://hapifhir.io
Apache License 2.0
2k stars 1.31k forks source link

HAPI JPA Server is rejecting ValueSet without url property #1875

Open jesusmorenomartin opened 4 years ago

jesusmorenomartin commented 4 years ago

Hi! When trying to create a ValueSet resource without the url property in R4 version, it throws an error:

{
  "resourceType": "OperationOutcome",
  "text": {
    "status": "generated",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><tr><td style=\"font-weight: bold;\">ERROR</td><td>[]</td><td><pre>ValueSet has no value for ValueSet.url</pre></td>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t</tr>\n\t\t</table>\n\t</div>"
  },
  "issue": [
    {
      "severity": "error",
      "code": "processing",
      "diagnostics": "ValueSet has no value for ValueSet.url"
    }
  ]
}

but this property is not mandatory in ValueSet resource:

image

As a curiosity, status is indeed mandatory, but HAPI FHIR allows not sending it.

You can test it using this curl:

curl --location --request POST 'http://hapi.fhir.org/baseR4/ValueSet' \
--header 'Content-Type: application/json' \
--data-raw '{
    "resourceType": "ValueSet"
}'

Is this an error or am I missing something?

Regards.

datencia commented 4 years ago

I'm facing the same issue.