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

[(servermethodbinding)] Fix method binding to handle special search n… #1373

Merged
merged 5 commits into from Oct 2, 2019

Conversation

@petromykhailysyn
Copy link
Contributor

petromykhailysyn commented Jul 9, 2019

In ca.uhn.fhir.rest.server.method.SearchMethodBinding#incomingServerRequestMatchesMethod underscore parameters are always considered matched except for the parameters _id and _language. This is handled by the loop:

for (String next : theRequest.getParameters().keySet()) {
if (next.startsWith("_") && !SPECIAL_SEARCH_PARAMS.contains(next)) {
methodParamsTemp.add(next);
}
}

There is though a bug in this implementation, since if the request parameters are qualified (_id:exact e.g.), then it will be considered matched because SPECIAL_SEARCH_PARAMS.contains(next) is false. This leads to failure since a request with _id:exact parameters will actually match a method with no _id parameter.

Petro Mykhaylyshyn added 4 commits Jul 9, 2019
…ames(_id:[modifier], _language:[modifier])
…into servermethodbinding
…into servermethodbinding
@dmitchellmim

This comment has been minimized.

Copy link

dmitchellmim commented Jul 17, 2019

Would this also fix _id:not? I noticed that on the test server, it returns exactly the opposite of what you'd expect. Example: http://hapi.fhir.org/baseDstu3/Patient?_id:not=1509209

@petromykhailysyn

This comment has been minimized.

Copy link
Contributor Author

petromykhailysyn commented Jul 18, 2019

Would this also fix _id:not? I noticed that on the test server, it returns exactly the opposite of what you'd expect. Example: http://hapi.fhir.org/baseDstu3/Patient?_id:not=1509209

My fix will not fix that issue because it's related to handle modifiers but I fixed registering provider methods issue.

@petromykhailysyn

This comment has been minimized.

Copy link
Contributor Author

petromykhailysyn commented Aug 1, 2019

@jamesagnew please review

tuomoa referenced this pull request Aug 2, 2019
Copy link
Owner

jamesagnew left a comment

Looks good, thanks for the contribution!

@jamesagnew jamesagnew merged commit 04e2802 into jamesagnew:master Oct 2, 2019
0 of 2 checks passed
0 of 2 checks passed
continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/appveyor/pr AppVeyor build failed
Details
jamesagnew added a commit that referenced this pull request Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.