title: Custom annotation validation does no validation on @pathParam in spring
body: <p>I wrote a custom validation to validate an id (Which is a path Param) as UUID in my @GET method of @RestController but this validation doesn't seem to be working. Even during the debug the control doesn't go to custom validation.</p>
  
  <pre><code>    @RestController
      @RequestMapping("/rateplan")
      @Validated
      public class RatePlanServiceController {
  
      @RequestMapping(value = "/{ratePlanId}", method = RequestMethod.GET)
      @ResponseStatus(HttpStatus.OK)
      public void get(@UUID @PathVariable("ratePlanId") String ratePlanId) {
  
          loggerFactory.warn("Get with Rate plan id {}", ratePlanId);
          loggerFactory.info("Get with Rate plan id {}", ratePlanId);
          loggerFactory.error("Get with Rate plan id {}", ratePlanId);
          loggerFactory.debug("Get with Rate plan id {}", ratePlanId);
  
          // return iRatePlanService.getRatePlan(ratePlanId);
      }
  }
  </code></pre>
  
  <p>I wrote the custom annotation for validation of UUID as follow.</p>
  
  <pre><code>import org.springframework.stereotype.Component;
  
  import javax.validation.Constraint;
  import javax.validation.ConstraintValidator;
  import javax.validation.ConstraintValidatorContext;
  import javax.validation.Payload;
  import java.lang.annotation.ElementType;
  import java.lang.annotation.Retention;
  import java.lang.annotation.RetentionPolicy;
  import java.lang.annotation.Target;
  import java.util.regex.Pattern;
  
  @Target(ElementType.PARAMETER)
  @Constraint(validatedBy = {UUID.IdValidator.class})
  @Retention(RetentionPolicy.RUNTIME)
  public @interface UUID {
      String message() default "{invalid.uuid}";
  
      Class&lt;?&gt;[] groups() default {};
  
      Class&lt;? extends Payload&gt;[] payload() default {};
  
      @Component
      public class IdValidator implements ConstraintValidator&lt;UUID, String&gt; {
  
  
          private static final Pattern id_PATTERN =
                  Pattern.compile("^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$");
  
          public boolean isValid(String value, ConstraintValidatorContext context) {
  
              if (!(id_PATTERN.matcher(value).matches())) {
                  return false;
              }
  
              return true;
          }
  
          public void initialize(UUID parameters) {
  
          }
  
      }
  }
  </code></pre>
  
  <p>Can anyone let me know why is it not working. Even if I provide a garbage ratePlanId like '345%#7^34' it able to go inside GET method.</p>