You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enhancement Request: IDE Warning for Missing @Validated in Non-Controller Components #1773
I would like to propose a new "Spring Linting" or "Validation" feature for STS to improve the developer experience and prevent common configuration pitfalls.
The Problem: When a developer uses the @Valid (JSR-303) annotation on a method parameter within a @Service or @Component class, Spring requires the class itself to be annotated with @Validated to enable the AOP-based method validation. Without @Validated at the class level, @Valid on parameters is silently ignored.
In my case, I spent an entire day debugging and eventually writing a custom Aspect just to handle validation in the Business Layer, simply because the IDE did not provide any hint that a proxy-enabling annotation was missing.
Proposed Feature: Add a "Quick Fix" or "Warning" (similar to the one for @Autowired on private fields) that detects:
A method parameter annotated with @Valid.
Inside a class annotated with @Service, @Component, or @Repository.
Missing @Validated at the class level.
Suggested Message:
"Method-level validation requires @Validated at the class level to be processed by Spring's MethodValidationPostProcessor. Would you like to add @Validated to [ClassName]?"
Impact: This small check would save countless hours for developers transitioning from Controller-level validation to Business-layer validation and reduce unnecessary boilerplate code (like custom aspects) created to solve a problem that Spring already handles.
Thanks for the enhancement request and the detailed description. Will ship as part of the 5.1.0 release.
Early access builds including this will appear shortly.
Activity
GH-1773: added validation to check for missing validated annotation o…
martinlippert commentedon Feb 9, 2026
Thanks for the enhancement request and the detailed description. Will ship as part of the
5.1.0release.Early access builds including this will appear shortly.