HubSpot / slack-client

An asynchronous HTTP client for Slack's web API
Apache License 2.0
114 stars 53 forks source link

Add compile-time checks for length of text in Section Blocks #191

Closed richardxu100 closed 3 years ago

richardxu100 commented 4 years ago

So e.g. https://github.com/HubSpot/slack-client/blob/master/slack-base/src/main/java/com/hubspot/slack/client/models/blocks/SectionIF.java

...I've been running into limits with section blocks needing to be <= 3000 characters long (link to slack api with this limitation described). I was wondering if it would be a good idea to add a Precondition in the check method, to make sure that the text field in our Section class is also <= 3000 characters. That way, we can know during compile time whether our section blocks have invalidly long text. Does that sound like a good addition to this project?

Originally posted by @richardxu100 in https://github.com/HubSpot/slack-client/issues/190#issuecomment-692222882