Add input validation #15

Open
opened 2026-03-16 22:29:57 +00:00 by austin · 0 comments
Owner

Validation is currently ad-hoc — inline empty string checks scattered across handlers. There's no enforcement of valid status/priority values, no format validation on project keys, and no length limits.

What needs to happen

Add validation methods on the input types or a small helper package. Rules:

  • Project keys: must match ^[A-Z]{2,5}$
  • Titles: non-empty, max 256 characters
  • Issue status: must be one of the known enum values (backlog, todo, in_progress, done, cancelled)
  • Issue priority: must be one of the known enum values (none, urgent, high, medium, low)
  • Descriptions: optional, max reasonable length

Return structured validation errors using the JSON error format from #14:

{"error": "validation_error", "details": [{"field": "key", "message": "must be 2-5 uppercase letters"}]}
Validation is currently ad-hoc — inline empty string checks scattered across handlers. There's no enforcement of valid status/priority values, no format validation on project keys, and no length limits. ## What needs to happen Add validation methods on the input types or a small helper package. Rules: - Project keys: must match `^[A-Z]{2,5}$` - Titles: non-empty, max 256 characters - Issue status: must be one of the known enum values (backlog, todo, in_progress, done, cancelled) - Issue priority: must be one of the known enum values (none, urgent, high, medium, low) - Descriptions: optional, max reasonable length Return structured validation errors using the JSON error format from #14: ```json {"error": "validation_error", "details": [{"field": "key", "message": "must be 2-5 uppercase letters"}]} ```
austin self-assigned this 2026-03-16 22:29:57 +00:00
austin added this to the Vektor - CLI project 2026-03-16 22:29:57 +00:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
austin/vektor#15
No description provided.