Skip to content

Update documentation on customizing validation errors with MessageSource #30653

Closed
@rstoyanchev

Description

@rstoyanchev

There is an i18n section, but it's more general, how to customize RFC 7807 error responses for any exception. For validation errors it says:

MethodArgumentNotValidException
{0} the list of global errors, {1} the list of field errors. 
Message codes and arguments for each error within the BindingResult are also resolved via MessageSource.

Validation errors could use dedicated coverage with example error codes and messages to show how to customize the individual errors that are included in arguments {0} abd {1}. The built-int web support for method validation in #30645 will add even more to this with validation errors directly on method parameters (as opposed to on fields in an Object).

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: documentationA documentation task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions