-
Notifications
You must be signed in to change notification settings - Fork 229
Empty users list in UsergroupsUsersUpdateRequest returns invalid_arguments #1573
Description
The SDK converts the users list into a comma delimited list of user ID strings to confirm with the form request it is making. However, for an empty List this is captured as an empty string, which is not valid for form requests. Ideally I would like to be able to set a usergroup to have 0 members via an empty List in the request object.
From testing with curl, it seems that for an empty list a value of [] can be provided into the url encoded form data to represent no users in a usergroup. This could be used instead of an empty value when an empty Java list is provided into the users parameter of a UsergroupUsersUpdateRequest object (either directly or via a request builder).
Reproducible in:
The Slack SDK version
+--- com.slack.api:slack-api-client:{strictly 1.48.0} -> 1.48.0
| +--- com.slack.api:slack-api-model:1.48.0
+--- com.slack.api:slack-api-client:{strictly 1.48.0} -> 1.48.0 (c)
+--- com.slack.api:slack-api-model:{strictly 1.48.0} -> 1.48.0 (c)
+--- com.slack.api:slack-api-client:1.48.0 (n)
+--- com.slack.api:slack-api-client:{strictly 1.48.0} -> 1.48.0
| +--- com.slack.api:slack-api-model:1.48.0
| +--- com.slack.api:slack-api-client:{strictly 1.48.0} -> 1.48.0 (*)
+--- com.slack.api:slack-api-client:{strictly 1.48.0} -> 1.48.0 (c)
+--- com.slack.api:slack-api-model:{strictly 1.48.0} -> 1.48.0 (c)
+--- com.slack.api:slack-api-client:{strictly 1.48.0} -> 1.48.0
| +--- com.slack.api:slack-api-model:1.48.0
+--- com.slack.api:slack-api-client:{strictly 1.48.0} -> 1.48.0 (c)
+--- com.slack.api:slack-api-model:{strictly 1.48.0} -> 1.48.0 (c)
+--- com.slack.api:slack-api-client:{strictly 1.48.0} -> 1.48.0
| +--- com.slack.api:slack-api-model:1.48.0
| +--- com.slack.api:slack-api-client:{strictly 1.48.0} -> 1.48.0 (*)
+--- com.slack.api:slack-api-client:{strictly 1.48.0} -> 1.48.0 (c)
+--- com.slack.api:slack-api-model:{strictly 1.48.0} -> 1.48.0 (c)
Java Runtime version
openjdk version "21.0.3" 2024-04-16
OpenJDK Runtime Environment JBR-21.0.3+13-453.2-jcef (build 21.0.3+13-b453.2)
OpenJDK 64-Bit Server VM JBR-21.0.3+13-453.2-jcef (build 21.0.3+13-b453.2, mixed mode, sharing)
OS info
ProductName: macOS
ProductVersion: 26.4
BuildVersion: 25E246
Steps to reproduce:
(Share the commands to run, source code, and project settings (e.g., pom.xml/build.gradle))
- Create a UsergroupsUsersUpdateRequest object with the
usersproperty set as an empty List, and appropriate values for the other properties - Make the request with the above object - this can be done via either async or sync methods
Expected result:
The targeted usergroup would be updated to have 0 users, with an appropriate OK response object.
Actual result:
A not-OK response is returned, with the error invalid_arguments.
{"ok":false,"error":"invalid_arguments"}Requirements
Please make sure if this topic is specific to this SDK. For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. 🙇
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you agree to those rules.