Skip to content

Commit

Permalink
Fix max length for static option values (#1655)
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
xoob authored Feb 17, 2025
1 parent f3be63f commit d6c206a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions slack_sdk/models/blocks/basic_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit d6c206a

Please sign in to comment.