diff --git a/pom.xml b/pom.xml
index e14286055..1fe50e6d8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -71,7 +71,7 @@
2.7.21
2.2
2.2.14.Final
- 1.3.0
+ 1.5.1
diff --git a/src/main/java/com/networknt/schema/DateTimeValidator.java b/src/main/java/com/networknt/schema/DateTimeValidator.java
index db3d4bae3..69a082e3c 100644
--- a/src/main/java/com/networknt/schema/DateTimeValidator.java
+++ b/src/main/java/com/networknt/schema/DateTimeValidator.java
@@ -65,7 +65,11 @@ private boolean isLegalDateTime(String string) {
return tryParse(() -> {
try {
ITU.parseDateTime(string);
- } catch (LeapSecondException ignored) {}
+ } catch (LeapSecondException ex) {
+ if(!ex.isVerifiedValidLeapYearMonth()) {
+ throw ex;
+ }
+ }
});
} else {
throw new IllegalStateException("Unknown format: " + formatName);
diff --git a/src/test/resources/draft2019-09/optional/format/date-time.json b/src/test/resources/draft2019-09/optional/format/date-time.json
index b183a8d02..6baa1a564 100644
--- a/src/test/resources/draft2019-09/optional/format/date-time.json
+++ b/src/test/resources/draft2019-09/optional/format/date-time.json
@@ -72,7 +72,7 @@
},
{
"description": "an invalid date-time string with leap second",
- "data": "1998-10-31T23:59:60Z",
+ "data": "1997-12-31T23:59:60Z",
"valid": false
}
]
diff --git a/src/test/resources/draft7/optional/format/date-time.json b/src/test/resources/draft7/optional/format/date-time.json
index b183a8d02..6baa1a564 100644
--- a/src/test/resources/draft7/optional/format/date-time.json
+++ b/src/test/resources/draft7/optional/format/date-time.json
@@ -72,7 +72,7 @@
},
{
"description": "an invalid date-time string with leap second",
- "data": "1998-10-31T23:59:60Z",
+ "data": "1997-12-31T23:59:60Z",
"valid": false
}
]