Here is my `Get` request:

```
@GetMapping("/stats/{fromDate}/{toDate}")
public StatsSummary getStatsSummary(@PathVariable String fromDate, @PathVariable String toDate) {

    logger.info("Calculating statistics between" + fromDate + ",to" + toDate);

    return statsService.getStatsSummary(fromDate, toDate);

}

```

I've tried adding the annotation `@NotBlank` as:

```
public StatsSummary getStatsSummary(@PathVariable String fromDate, @PathVariable @NotBlank String toDate) {

```

but when I invoke `/stats/2020-05-30/` which does not include `toDate` I receive the response:

```
{
    "timestamp": "2020-09-04T06:02:46.567+00:00",
    "status": 404,
    "error": "Not Found",
    "message": "No message available",
    "path": "/stats/2020-05-30/"
}

```

So the annotation is not being registered correctly?

Update:

It seems PathVariable is not meant to be validated:

[The validators (@Validated @Valid) do not work with Spring and TomEE](https://stackoverflow.com/questions/53997703/the-validators-validated-valid-do-not-work-with-spring-and-tomee)
['https://Stackoverflow.com/questions/63735775', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/470184/']
Actually Spring by sending 404 returns correct answer to a client.
When someone doesn't provide full URL, the 404 is the status to respond.

The proper way to validate that is to use some date class like **Date** or **LocalDate** or similar instead of **String**.
Probably you'll need to define proper formatting of date so take a look at the following link for details.
<https://www.baeldung.com/spring-date-parameters>
Add the following annotation to the class worked for me.(Not to the method)

```
@Validated

```