Skip to main content
Python v3.1.0

Validation boundaries

Slackblocks checks the shared model and its declared contextual rules. Successful local construction is not a Slack API receipt: permissions, enabled features, receiving surfaces and write-path rules still apply. Native normalization and error handling are described below.

The following rules were reviewed against official Slack references and minimal blocks.validate view probes on 2026-10-13. The sanitized requests and responses are retained in spec/evidence/SB-013-validation-boundary.json. Those probes establish structural validation results, not views.open or message posting results.

Field or combinationLibrary guaranteeEvidence and boundary
Plain-text input min_length and max_lengthEach retains its documented scalar range; when both are supplied, minimum must not exceed maximum. Equality, zero minimum and omitted bounds are supported.This is an explicit library consistency rule derived from the minimum/maximum meanings. Slack's structural validator accepted the reversed pair 20/10; this stricter library rule prevents an unsatisfiable input.
External select min_query_length, single and multiAn explicitly supplied threshold must be nonnegative; zero is preserved.Slack's select and multi-select docs describe a character count. The validator accepted zero and rejected minus one for both families.
Static select options and option_groups, single and multiEach supplied list must contain at least one item; the existing maximum and mutual-exclusion rules still apply.Empty lists were rejected with min_items: 1; corresponding one-item lists passed. This does not make an external options-response payload subject to static-menu constraints.
Date picker initial_dateThe string must have the ASCII YYYY-MM-DD shape.The date-picker reference specifies this format. The validator rejected a prose date but accepted 2028-02-30. Native calendar handling is described below. Validate calendar/business constraints in the application.
Time picker initial_timeThe string must be an ASCII, zero-padded 24-hour time from 00:00 through 23:59.The time-picker reference specifies HH:mm; the validator rejected 9:00 and 25:99, and accepted 23:59.
Image-element alt_textThe existing maximum remains; an empty string is permitted.The image reference does not establish a positive minimum. Empty and nonempty controls both passed structural validation.

Invalid ordered bounds and negative query thresholds use out-of-range; malformed dates/times use type-mismatch; empty static lists use length-exceeded. These checks deliberately reject previously accepted invalid configurations. The shared contract does not infer new calendar-validity or positive image-alt-text minimum rules from an application failure.

Native validation behavior​

Errors expose the corresponding RangeError, TypeMismatchError or LengthError class and a diagnostic message. The existing calendar parser also rejects an impossible date such as 2028-02-30 and may raise ValueError.

Remove an optional argument to request omission. Some serializers retain legacy truthiness normalization; see omission and defaults when explicit zero or False matters.