spring-validation

Enforce Jakarta Validation constraints on Spring Boot input models.

Updated Feb 7, 2026
One-click install
npx skills add https://github.com/gazolla/gazapps-java-skills --skill spring-validation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spring-validation
Source: https://github.com/gazolla/gazapps-java-skills/tree/main/spring-validation
Command: npx skills add https://github.com/gazolla/gazapps-java-skills --skill spring-validation

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Bean Validation in Spring Boot enforces data integrity across DTOs, controllers, and services by providing reusable constraints, cross-field checks, and custom validators with internationalized messages.

Core Features & Use Cases

  • Built-in constraints (NotNull, NotBlank, Size, Pattern, Email, etc.) applied to request payloads and domain models
  • Custom constraint annotations and cross-field validation to enforce business rules
  • Validation groups for create vs update scenarios
  • Nested object and collection validation with @Valid and container element constraints
  • Method-level validation for service layer methods
  • Internationalization of error messages and error formatting (RFC 7807 patterns)

Quick Start

Annotate your DTO fields with the appropriate Jakarta Validation annotations to enforce rules on incoming requests.

Frequently Asked Questions about spring-validation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate request body DTOs in Spring Boot?

Annotate your DTO fields with Jakarta Validation constraints like NotNull or Size to enforce data validation rules on incoming request bodies and domain models in Spring Boot.

What is the best way to handle create vs update validation rules in Spring Boot?

Use validation groups to separate create vs update scenarios in Spring Boot, allowing you to apply different constraint sets to the same DTO fields depending on the API operation.

Can I enforce cross-field validation and custom business rules on Spring Boot DTOs?

Yes, you can enforce cross-field validation by creating custom constraint annotations and custom validators that implement your specific business rules across multiple DTO fields.

Does Spring Boot bean validation support nested objects and collections?

Spring Boot bean validation supports nested objects and collections by applying the @Valid annotation to complex fields, ensuring deep validation of container elements and child models.

How do I internationalize bean validation error messages in a Spring Boot API?

Internationalize bean validation error messages by defining custom message sources in Spring Boot, formatting errors into standard RFC 7807 patterns for consistent API responses.

Why use Jakarta Validation for method-level validation in Spring Boot services?

Jakarta Validation enforces method-level constraints on service layer parameters and return values in Spring Boot, preventing invalid data from propagating past your controllers into business logic.