Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$expand with an invalid filter returns 500 instead of 422 #516

jimsteel opened this issue Nov 24, 2016 · 1 comment

$expand with an invalid filter returns 500 instead of 422 #516

jimsteel opened this issue Nov 24, 2016 · 1 comment


Copy link

@jimsteel jimsteel commented Nov 24, 2016

POSTing a ValueSet to $expand, where the valueset uses an invalid filter operator, results in an IllegalArgumentException. It would be good if this could be caught somewhere and thrown as a UnprocessableEntityException, so it comes out as a 422 response.

Example follows.

curl -X POST -H "Content-Type: application/json+fhir" -H "Cache-Control: no-cache" -d '{ "resourceType": "ValueSet", "url": "http://sample/ValueSet/education-levels", "version": "1", "name": "Education Levels", "status": "draft", "compose": { "include": [ { "filter": [ { "property": "n", "op": "n", "value": "365460000" } ], "system": "" } ], "exclude": [ { "concept": [ { "code": "224298008" }, { "code": "365460000" }, { "code": "473462005" }, { "code": "424587006" } ], "system": "" } ] }, "description": "A selection of Education Levels", "text": { "status": "generated", "div": "<div xmlns=\"\"><h2>Education Levels</h2><tt></tt><p>A selection of Education Levels</p></div>" }, "experimental": true, "date": "2016-07-26" }' ""

lawley added a commit to aehrc/hapi-fhir that referenced this issue Dec 6, 2016
jamesagnew added a commit that referenced this issue Dec 10, 2016
#516 Report invalid values for enums through parser error handler
Copy link

@jamesagnew jamesagnew commented Dec 10, 2016

Thanks for reporting! Checking in a fix now.

FYI the fix for #525 had the side effect that this invalid code would now be ignored entirely and the server would just ignore the filter. With the checkin about to come, the server return an HTTP 400 when it receives an invalid code (unless the parserErrorHandler has been configured to ignore this problem)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.