403-frameworks-quarkus-validation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Quarkus Validation Guidelines

Quarkus验证指南

Apply Quarkus validation best practices at REST boundaries.
What is covered in this Skill?
  • Bean Validation annotations on DTOs and command models
  • @Valid and boundary validation in Jakarta REST resources
  • Validation groups and custom constraints
  • Validation error mapping for client-safe responses
  • Consistent handling of invalid inputs across endpoints
Scope: Apply recommendations based on the reference rules and good/bad examples.
在REST边界应用Quarkus验证最佳实践。
本Skill涵盖哪些内容?
  • DTO和命令模型上的Bean Validation注解
  • Jakarta REST资源中的@Valid注解与边界验证
  • 验证组与自定义约束
  • 面向客户端安全响应的验证错误映射
  • 跨端点统一处理无效输入
范围: 基于参考规则和正反示例应用建议。

Constraints

约束条件

Before applying validation changes, ensure the project compiles. After improvements, run full verification.
  • MANDATORY: Run
    ./mvnw compile
    or
    mvn compile
    before applying any change
  • SAFETY: If compilation fails, stop immediately
  • VERIFY: Run
    ./mvnw clean verify
    or
    mvn clean verify
    after applying improvements
  • BEFORE APPLYING: Read the reference for detailed rules and examples
在应用验证变更之前,确保项目可以编译。完成改进后,运行完整验证。
  • 强制要求:在进行任何变更前运行
    ./mvnw compile
    mvn compile
  • 安全提示:如果编译失败,立即停止操作
  • 验证步骤:完成改进后运行
    ./mvnw clean verify
    mvn clean verify
  • 应用前准备:阅读参考文档了解详细规则和示例

When to use this skill

何时使用本Skill

  • Add validation support in Quarkus
  • Review Quarkus validation rules
  • Improve request validation in Quarkus REST APIs
  • Add custom validation constraints in Quarkus
  • Validate Quarkus @ConfigMapping properties
  • Improve validation error mapping with ExceptionMapper in Quarkus
  • 在Quarkus中添加验证支持
  • 审查Quarkus验证规则
  • 改进Quarkus REST API中的请求验证
  • 在Quarkus中添加自定义验证约束
  • 验证Quarkus的@ConfigMapping属性
  • 在Quarkus中使用ExceptionMapper改进验证错误映射

Workflow

工作流程

  1. Read reference and assess project context
Read
references/403-frameworks-quarkus-validation.md
and inspect the current project setup before proposing changes.
  1. Gather scope and decide target improvements
Identify requested outcomes, constraints, and the minimum safe set of changes to apply.
  1. Apply framework-aligned changes
Implement or refactor validation-related configuration/code following the reference patterns and project conventions.
  1. Run verification and report results
Execute appropriate build/tests and summarize what changed, what was verified, and any follow-up actions.
  1. 阅读参考文档并评估项目上下文
在提出变更前,阅读
references/403-frameworks-quarkus-validation.md
并检查当前项目配置。
  1. 确定范围并制定目标改进方案
明确预期结果、约束条件以及可应用的最小安全变更集。
  1. 应用符合框架规范的变更
遵循参考模式和项目约定,实现或重构验证相关的配置/代码。
  1. 运行验证并报告结果
执行相应的构建/测试,总结变更内容、验证结果以及后续行动。

Reference

参考文档

For detailed guidance, examples, and constraints, see references/403-frameworks-quarkus-validation.md.
如需详细指南、示例和约束条件,请查看references/403-frameworks-quarkus-validation.md