From 2a2c4154be707426d46e1315f629c1ee29e3350e Mon Sep 17 00:00:00 2001 From: "Michael J. Simons" Date: Wed, 5 Apr 2017 22:18:26 +0200 Subject: [PATCH] DATAREST-1046 - Fix instructions how to manually add a validator. Original pull request: #264. --- src/main/asciidoc/validation.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/asciidoc/validation.adoc b/src/main/asciidoc/validation.adoc index 5313566d1..ae7c5e483 100644 --- a/src/main/asciidoc/validation.adoc +++ b/src/main/asciidoc/validation.adoc @@ -7,7 +7,7 @@ In order to tell Spring Data REST you want a particular `Validator` assigned to == Assigning Validators manually -If you would rather not use the bean name prefix approach, then you simply need to register an instance of your validator with the bean whose job it is to invoke validators after the correct event. In your configuration that subclasses Spring Data REST's `RepositoryRestMvcConfiguration`, override the `configureValidatingRepositoryEventListener` method and call the `addValidator` method on the `ValidatingRepositoryEventListener`, passing the event you want this validator to be triggered on, and an instance of the validator. +If you would rather not use the bean name prefix approach, then you simply need to register an instance of your validator with the bean whose job it is to invoke validators after the correct event. In your configuration that implements `RepositoryRestConfigurer` or subclasses Spring Data REST's `RepositoryRestConfigurerAdapter`, override the `configureValidatingRepositoryEventListener` method and call `addValidator` on the `ValidatingRepositoryEventListener`, passing the event you want this validator to be triggered on, and an instance of the validator. [source,java] ----