diff --git a/src/main/java/org/zalando/nakadi/validation/MetadataValidator.java b/src/main/java/org/zalando/nakadi/validation/MetadataValidator.java index 467c714738..15e6188aae 100644 --- a/src/main/java/org/zalando/nakadi/validation/MetadataValidator.java +++ b/src/main/java/org/zalando/nakadi/validation/MetadataValidator.java @@ -17,6 +17,7 @@ public Optional accepts(final JSONObject event) { } private Optional checkDateTime(final String occurredAt) { - return validator.validate(occurredAt).map(ValidationError::new); + return validator.validate(occurredAt) + .map(e-> new ValidationError("#/metadata/occurred_at:" + e)); } } diff --git a/src/main/java/org/zalando/nakadi/validation/RFC3339DateTimeValidator.java b/src/main/java/org/zalando/nakadi/validation/RFC3339DateTimeValidator.java index d7fb692d35..d6ceb8f16f 100644 --- a/src/main/java/org/zalando/nakadi/validation/RFC3339DateTimeValidator.java +++ b/src/main/java/org/zalando/nakadi/validation/RFC3339DateTimeValidator.java @@ -35,7 +35,7 @@ public Optional validate(final String dateTime) { } } catch (final DateTimeParseException e) { - return error; + return Optional.of(error.get() + " " + e.getMessage()); } } }