id: validate-requests-with-i18n
trigger: "when defining or validating Controller request DTOs in foodie_server"
confidence: 0.9
domain: "code-style"
source: "explicit-user-instruction"
Validate request data with internationalized messages
Action
- Keep request DTOs as data carriers; do not add Bean Validation annotations such as
@NotNull, @NotBlank, or @Size to DTO fields.
- Do not rely on
@Valid or @Validated on Controller DTO parameters to produce validation responses.
- Validate business request parameters in the Controller or Service layer.
- Resolve every user-facing validation error through the project's internationalization mechanism, such as
MessageUtils.message(...); do not hardcode a single-language validation message.
Evidence
- The user explicitly required DTO validation to be avoided because validation error messages must support internationalization on 2026-08-10.