title: Spring REST Controller PathVariable: NumberFormatException
body: <p>I have a Spring controller method, which looks like this:</p>
  <pre><code>@GetMapping(&quot;/{id}&quot;)
  public ResponseEntity&lt;ResultType&gt; getStuff(@NotNull @Min(0) @PathVariable(&quot;id&quot;) Integer id) {
      // ...
  }
  </code></pre>
  <p>The problem I face is whenever I send a request to <code>/somestring</code>, I get a <code>NumberFormatException</code> on the path variable because the path variable isn't a number.</p>
  <p>I'd like a bit nicer validation for this (hence the <code>@Min(0)</code>), but the result is the same. It feels like the validation is run after the path variable conversion. What can I do to reverse this order?</p>
  <p>Spring Boot version: 2.6.6</p>