From d6c206a959c00b1e3a5d8eb17ca4626566456b8f Mon Sep 17 00:00:00 2001 From: Alex Brausewetter Date: Mon, 17 Feb 2025 17:28:27 +0100 Subject: [PATCH] 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 ``` --- slack_sdk/models/blocks/basic_components.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slack_sdk/models/blocks/basic_components.py b/slack_sdk/models/blocks/basic_components.py index 143d18e3..dcbcf062 100644 --- a/slack_sdk/models/blocks/basic_components.py +++ b/slack_sdk/models/blocks/basic_components.py @@ -170,7 +170,7 @@ class Option(JsonObject): logger = logging.getLogger(__name__) label_max_length = 75 - value_max_length = 75 + value_max_length = 150 def __init__( self, @@ -201,7 +201,7 @@ def __init__( Cannot exceed 75 characters. value: A short string that identifies this particular option to your application. It will be part of the payload when this option is selected - . Cannot exceed 75 characters. + . Cannot exceed 150 characters. description: A user-facing string that provides more details about this option. Only supported in legacy message actions, not in blocks or dialogs.