Value property in an Option limited to 75 chars in its model class
See original GitHub issueThe documentation states the value field of the option can accepted values up to 2000 chars in length. When creating an Option object with a value of 76 chars it throws an exception.
slack_sdk.errors.SlackObjectFormationError: value attribute cannot exceed 75 characters
Reproducible in:
from slack_bolt import App
from slack_sdk.models.blocks import ActionsBlock
from slack_sdk.models.blocks.block_elements import Option, StaticSelectElement
options = [
Option(label="Sample Label", value="x" * 76),
]
select_drop = StaticSelectElement(
placeholder="Select Something", action_id="select", options=options
)
action_block = ActionsBlock(
elements=[select_drop],
block_id="action_block",
)
app = App()
response = app.client.chat_postMessage(
channel="my_channel",
blocks=[action_block],
text="Message with dropdown"
)
pass
The Slack SDK version
slack-bolt==1.7.0 slack-sdk==3.8.0
Python runtime version
Python 3.9.5
OS info
ProductName: macOS ProductVersion: 11.4 BuildVersion: 20F71 Darwin Kernel Version 20.5.0: Sat May 8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64
Steps to reproduce:
Run python snippet above
Expected result:
Successful posting as the char length of value of 76 is less than the documentation stated limit of 2000
Actual result:
Exception indicating the char length limit of value is 75 chars
slack_sdk.errors.SlackObjectFormationError: value attribute cannot exceed 75 characters
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Value property in an Option limited to 75 chars in its model class
Value property in an Option limited to 75 chars in its model class. ... states the value field of the option can accepted...
Read more >Setting a max character length in CSS - html - Stack Overflow
An example with truncation on 3 rows. You could see what space occur 75 characters according to your typography and set a max-width...
Read more >max-width - CSS: Cascading Style Sheets - MDN Web Docs
The max-width CSS property sets the maximum width of an element. It prevents the used value of the width property from becoming larger...
Read more >A quick tour of attribute domains—ArcMap | Documentation
Using domains helps ensure data integrity by limiting the choice of values for a particular field. Attribute domains can be shared across feature...
Read more >Visualization: Column Chart - Google Developers
Overview. A column chart is a vertical bar chart rendered in the browser using SVG or VML, whichever is appropriate for the user's...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Let us close this issue now but please feel free to write in whenever you have anything further to ask/discuss here!
Hi @andrewhharmon, thanks for taking the time to write in here!
As you’ve already noticed yourself, the maximum value of
value
property is 75 whilevalue
in interactive components like buttons can have 2K characters. Thus, the current implementation of the validation should be valid.Regarding the pattern using dict values instead of model class objects, the SDK side value validation does not work for the dict data. Thus, it is also an expected behavior.
If everything is clear now, would you mind closing this issue?