vertx-json-schema icon indicating copy to clipboard operation
vertx-json-schema copied to clipboard

Pattern FASTDATETIME does not catch invalid dates like 31 November

Open AmraKu opened this issue 2 years ago • 0 comments

Version

4.3.5

Context

The validation using pattern FASTDATETIME fails to catch invalid dates where the day is within the 1-31 range, but the month does not have 31 days (e.g. 31 November).

Solution

The definition of private static boolean testDateTime(String value) here should be rewritten to return

Instant.parse(value);

instead of

FASTDATETIME.matcher(value).find();

AmraKu avatar Feb 06 '23 09:02 AmraKu