Repository: networknt/json-schema-validator (java)

Issue:
LocalDateTime validation error
validation error on java.time.LocalDateTime:

for example:
    "lastUpdated": "2018-11-15T21:08:59",

validation error:
{"statusCode":400,"code":"ERR11004","message":"VALIDATOR_SCHEMA","description":"Schema Validation Error - $.lastUpdated: does not match the date-time pattern ^\\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(0?[1-9]|[12][0-9]|3[01])[tT ]\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?([zZ]|[+-]\\d{2}:\\d{2})$","severity":"ERROR"}

change it to:     "lastUpdated": "2018-11-15T21:08:59Z" will pass the validation.

But when we load from attachment the value change back: "lastUpdated": "2018-11-15T21:08:59"


Pull request description:
fixes #114

Patch:
diff --git a/src/main/java/com/networknt/schema/JsonMetaSchema.java b/src/main/java/com/networknt/schema/JsonMetaSchema.java
index 049af19..8a8eacd 100644
--- a/src/main/java/com/networknt/schema/JsonMetaSchema.java
+++ b/src/main/java/com/networknt/schema/JsonMetaSchema.java
@@ -46,7 +46,7 @@ public class JsonMetaSchema {
         public static final List<Format> BUILTIN_FORMATS = new ArrayList<Format>();
         static {
             BUILTIN_FORMATS.add(pattern("date-time", 
-                    "^\\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(0?[1-9]|[12][0-9]|3[01])[tT ]\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?([zZ]|[+-]\\d{2}:\\d{2})$"));
+                    "^\\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(0?[1-9]|[12][0-9]|3[01])[tT ]\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?([zZ]?|[+-]\\d{2}:\\d{2})$"));
             BUILTIN_FORMATS.add(pattern("date", "^\\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(0?[1-9]|[12][0-9]|3[01])$"));
             BUILTIN_FORMATS.add(pattern("time", "^\\d{2}:\\d{2}:\\d{2}$"));
             BUILTIN_FORMATS.add(pattern("email", "^\\S+@\\S+$"));


Test patch:
diff --git a/src/test/resources/tests/optional/format.json b/src/test/resources/tests/optional/format.json
index 6ac59b6..34236d3 100644
--- a/src/test/resources/tests/optional/format.json
+++ b/src/test/resources/tests/optional/format.json
@@ -24,10 +24,30 @@
                 "valid": false
             },
             {
-                "description": "an invalid date-time string",
+                "description": "an valid date-time string",
                 "data": "1963-12-31T08:30:06.283185Z",
                 "valid": true
             },
+            {
+                "description": "an valid date-time string",
+                "data": "1963-12-30T08:30:06.283Z",
+                "valid": true
+            },
+            {
+                "description": "an valid date-time string",
+                "data": "1963-12-30T08:30:06.283",
+                "valid": true
+            },
+            {
+                "description": "an valid date-time string",
+                "data": "1963-12-30T08:30:06",
+                "valid": true
+            },
+            {
+                "description": "an valid date-time string",
+                "data": "1963-12-30T08:30:06Z",
+                "valid": true
+            },
             {
                 "description": "only RFC3339 not all of ISO 8601 are valid",
                 "data": "2013-350T01:01:01",