0

I have a Controller that receives an object as the request body:

public String getSomething(@RequestBody final SomeRequest request) {  }

The SomeRequest object has a field that needs to be validated against a list of known strings that reside in an environment specific .properties file.

public class SomeRequest() {
    @CustomIdValidator(/** possible parameters */)
    private final String id;
}

Is it somehow possible to give the CustomIdValidator annotation parameters from the .properties file and do the validation there? The validator is used extensively so having it as an annotation is preferred.

tomtomssi
  • 1,017
  • 5
  • 20
  • 33

0 Answers0