During working on the TaaS API we came across with the next issue.
If we make a request with enrich=true everything works well, for example https://api.topcoder-dev.com/v5/users?enrich=true&externalProfile.organizationId=36ed815b-3da1-49f1-a043-aaed0a4e81ad&externalProfile.externalId=40159127 returns an array with one user
but if we are making the same request without enrich, then U-bahn endpoint returns some random array of multiple users instead of the required user, I guess it doesn't filter result by externalId in such case, for example URL https://api.topcoder-dev.com/v5/users?enrich=false&externalProfile.organizationId=36ed815b-3da1-49f1-a043-aaed0a4e81ad&externalProfile.externalId=40159127 returns
[
{"lastName":"Underwood","firstName":"Christina","updatedBy":"tcAdmin","createdBy":"Talend","created":"2021-01-20T03:56:20.459Z","handle":"christina_uw","id":"79ce2a3e-7679-48cf-8ac9-0a8ca4c4b463","updated":"2021-01-20T03:56:20.459Z"},
{"lastName":"Mess","firstName":"Mess","updatedBy":"tcAdmin","createdBy":"Talend","created":"2021-01-20T03:56:20.443Z","handle":"mess","id":"98ec2c16-442e-4b61-8ad1-66123ee37d3c","updated":"2021-01-20T03:56:20.443Z"},
{"lastName":"Chennaveerappa Mruthyunja","firstName":"Nagendrakumar","updatedBy":"tcAdmin","createdBy":"Talend","created":"2021-01-20T03:56:20.459Z","handle":"cmnkumar.123","id":"4dfc6090-4ba8-4387-b5c4-584fcef982ba","updated":"2021-01-20T03:56:20.459Z"},
... and so on
]
Suggestion
I suggest returning an explicit error when the user tries to filter by externalProfile but enrich !== true. As most likely user would get in response not what they are expecting.
Context
During working on the TaaS API we came across with the next issue.
enrich=true
everything works well, for examplehttps://api.topcoder-dev.com/v5/users?enrich=true&externalProfile.organizationId=36ed815b-3da1-49f1-a043-aaed0a4e81ad&externalProfile.externalId=40159127
returns an array with one userenrich
, then U-bahn endpoint returns some random array of multiple users instead of the required user, I guess it doesn't filter result byexternalId
in such case, for example URLhttps://api.topcoder-dev.com/v5/users?enrich=false&externalProfile.organizationId=36ed815b-3da1-49f1-a043-aaed0a4e81ad&externalProfile.externalId=40159127
returnsSuggestion
I suggest returning an explicit error when the user tries to filter by
externalProfile
butenrich !== true
. As most likely user would get in response not what they are expecting.References
We almost missed this difference in behavior and only QA caught it, see https://github.com/topcoder-platform/taas-apis/issues/154#issuecomment-788779015