Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method validation error handling by controller method parameter type #30813

Closed
Tracked by #30645
rstoyanchev opened this issue Jul 4, 2023 · 1 comment
Closed
Tracked by #30645
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@rstoyanchev
Copy link
Contributor

As described under #26219, in #26219 (comment) and #26219 (comment), when handling method validation errors, it's useful to know what it relates to, e.g. header name, cookie value, etc.

After #29825 and #30644 it is already possible to get a MethodParameter from each ParameterValidationResult and check parameter annotations. We can make it even easier to handle validation results for controller methods by method parameter type.

@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement labels Jul 4, 2023
@rstoyanchev rstoyanchev added this to the 6.1.0-M2 milestone Jul 4, 2023
@rstoyanchev rstoyanchev self-assigned this Jul 4, 2023
@rstoyanchev rstoyanchev changed the title Controller method validation error handling by method parameter type Method validation error handling by controller method parameter type Jul 4, 2023
@rstoyanchev
Copy link
Contributor Author

rstoyanchev commented Jul 4, 2023

HandlerMethodValidationException now has a visitResults method that takes a Visitor to handle validation results by controller method parameter type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant