Minimal Access API Error Message is Not Descriptive
The message, access_level is not included in the list, returned when an API call attempts to assign minimal access to a subgroup user does not tell what the issue is.
The message should tell the caller why it failed. The real reason it failed is because minimal access level is only supported for top level groups. Initial thought is the message should say "minimal access level only applicable on top level group".
Curl command and output below.
curl --request PUT --header "PRIVATE-TOKEN: $GL_TOKEN" "https://gitlab.com/api/v4/groups/GROUP_ID/members/MEMBER_ID?access_level=5"
{"message":{"access_level":["is not included in the list"]}}%
The same message is returned when an attempt to add a user with minimal access to a subgroup is made.
Curl command and output below.
curl --request POST --header "PRIVATE-TOKEN: $GL_TOKEN" "https://gitlab.com/api/v4/groups/GROUP_ID/members?user_id=MEMBER_ID&access_level=5"
{"message":{"access_level":["is not included in the list"]}}%
Edited by Mark Smith