Skip to content

Commit d6c206a

Browse files
authored
Fix max length for static option values (#1655)
According to the docs, this property accepts a maximum length of 150 chars whereas the SDK enforces 75. - https://api.slack.com/reference/block-kit/composition-objects#option > `value`: (String) A unique string value that will be passed to your app when this option is chosen. Maximum length for this field is 150 characters. Without this fix, we can get validation errors: ``` slack_sdk.errors.SlackObjectFormationError: value attribute cannot exceed 75 characters ```
1 parent f3be63f commit d6c206a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

slack_sdk/models/blocks/basic_components.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class Option(JsonObject):
170170
logger = logging.getLogger(__name__)
171171

172172
label_max_length = 75
173-
value_max_length = 75
173+
value_max_length = 150
174174

175175
def __init__(
176176
self,
@@ -201,7 +201,7 @@ def __init__(
201201
Cannot exceed 75 characters.
202202
value: A short string that identifies this particular option to your
203203
application. It will be part of the payload when this option is selected
204-
. Cannot exceed 75 characters.
204+
. Cannot exceed 150 characters.
205205
description: A user-facing string that provides more details about
206206
this option. Only supported in legacy message actions, not in blocks or
207207
dialogs.

0 commit comments

Comments
 (0)