$validate operation returns 200 OK when it should return a 500 Server Error #3735
Description
Describe the bug
When you invoke $validate at the resource-type level (not the instance level) and an unexpected server error occurs, the current implementation returns a 200 OK with an OperationOutcome description like "An error occurred during validation".
Environment
main
To Reproduce
Steps to reproduce the behavior:
- register a profile with known bad FHIRPath or something similar to force the server to throw during validation (instead of returning an issue list)
- invoke $validate at the resource type level
Note the generic error message and the fact that we are missing the exception info in the logs.
Expected behavior
per http://hl7.org/fhir/operation-resource-validate.html
This operation returns a 200 OK whether or not the resource is valid. A 4xx or 5xx error means that the validation itself could not be performed, and it is unknown whether the resource is valid or not.
I think this should be a 5xx.
However, it will be good to confirm that the failure to parse the incoming resource continues to fail with either a 200 OK (with OperationOutcome indicating the failure) or with a 4xx response code.
Additional context