Length limit for UserAction fields (vibe-kanban e9ec1f07)

Add the following length limit to UserAction fields:

- limit the length of `id` to 20 chars.
- limit the length of title to 40 chars.

Add some unit tests to ensure the validation rules are enforced.
This commit is contained in:
QuantumGhost
2026-01-16 18:18:37 +08:00
parent 1f47ea8452
commit 7bc7a8d0ab
2 changed files with 30 additions and 2 deletions

View File

@ -166,8 +166,8 @@ class UserAction(BaseModel):
# It also serves as the identifiers of output handle.
#
# The id must be a valid identifier (satisfy the _IDENTIFIER_PATTERN above.)
id: str
title: str
id: str = Field(max_length=20)
title: str = Field(max_length=20)
button_style: ButtonStyle = ButtonStyle.DEFAULT
@field_validator("id")