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

No error message issued when passing in a incorrect resource on _revinclude. #1629

Closed
d0roppe opened this issue Oct 27, 2020 · 3 comments
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@d0roppe
Copy link
Collaborator

d0roppe commented Oct 27, 2020

Describe the bug
A clear and concise description of what the bug is.
When searching with the following get statement:
https://localhost:7000/fhir-server/api/v4/Patient?_id=&_revinclude=Provedance:*
there is no resource Provedance, but the fhir server did not issue an error. it just dropped it and processed the search.

"url": "https://localhost:9443/fhir-server/api/v4/Patient?_count=10&_id=&_page=1"

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.
With the fact that the resource type is an error it should give a error message vs dropping the _revinclude

Additional context
Add any other context about the problem here.

@d0roppe d0roppe added the bug Something isn't working label Oct 27, 2020
@kmbarton423 kmbarton423 added this to the Sprint 21 milestone Nov 16, 2020
@kmbarton423
Copy link
Contributor

lenient vs strict mode consideration

@michaelwschroeder michaelwschroeder self-assigned this Nov 17, 2020
@michaelwschroeder
Copy link
Contributor

If running in strict mode, an error will be returned if an invalid target resource type is specified in a _revinclude query parameter. If running in lenient mode, the error message will be logged and the invalid _revinclude query parameter will be ignored.

In addition, changes will be made to _include/_revinclude processing to handle errors more consistently when running in lenient mode. Currenty, if multiple _include or _revinclude query parameters are specified and an error is found in one of them, all will be ignored, with the exception of a bad search parameter being found. In that case, only the query parameter with the bad search parameter is ignored. With the new changes, when running in lenient mode, if an error is found processing a query parameter, only that query parameter will be ignored. Any valid _include or _revinclude query parameters will be included in the search query. Note that this applies only if running in lenient mode. If running in strict mode, any error found will result in a failed search request.

michaelwschroeder added a commit that referenced this issue Nov 19, 2020
Signed-off-by: Mike Schroeder <mschroed@us.ibm.com>
michaelwschroeder added a commit that referenced this issue Nov 19, 2020
Signed-off-by: Mike Schroeder <mschroed@us.ibm.com>
michaelwschroeder added a commit that referenced this issue Nov 20, 2020
Signed-off-by: Mike Schroeder <mschroed@us.ibm.com>
michaelwschroeder added a commit that referenced this issue Nov 20, 2020
Issue #1629 - return error if bad resource type on revinclude
@d0roppe
Copy link
Collaborator Author

d0roppe commented Dec 1, 2020

Verified that in strict mode now this throws an error 400 and does not process the search. And in lenient mode the error part of the command is ignored and dropped, and the search is processed.

@d0roppe d0roppe closed this as completed Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants