API /members/{member_email}/groups endpoint contract discrepancy
Description:
There is an endpoint on Entitlements list-group-on-behalf-of-api - GET /members/{member_email}/groups
used for getting a list of certain user groups. Its Swagger spec says it has an optional query parameter "type".
This is not accurate. Indeed, the parameter is mandatory. Trying to run without it one gets an error:
https://{{ENTITLEMENTS_HOST}}/members/:member_email/groups
{
"code": 400,
"reason": "Bad Request",
"message": "Invalid filter"
}
It expects a value from the org.opengroup.osdu.entitlements.v2.model.GroupType, one of: NONE, DATA, USER, SERVICE.
This mitigation is in contradiction with the spec, and this explicit format seems excessive and not convenient.
Moreover, the spec doesn't list the admitted type codes, so, a user has no chance to guess of them.
Changes include:
-
Refactor (a non-breaking change that improves code maintainability). -
Bugfix (a non-breaking change that solves an issue). -
New feature (a non-breaking change that adds functionality). -
Breaking change (a change that is not backward-compatible and/or changes current functionality).
Changes in:
-
GCP -
Common code
Dev Checklist:
-
Added Unit Tests, wherever applicable. -
Updated the Readme, if applicable. -
Existing Tests pass -
Verified functionality locally -
Self Reviewed my code for formatting and complex business logic.
Edited by Rustam Lotsmanenko (EPAM)