[ML] Set createTime if not specified in validate api too
Original commit: elastic/x-pack-elasticsearch@477fb0fc52dc442d18ccdd8f6500acbac2e580fe
@@ -68,6 +68,9 @@ extends Action<ValidateJobConfigAction.Request, ValidateJobConfigAction.Response
// When jobs are PUT their ID must be supplied in the URL - assume this will
// be valid unless an invalid job ID is specified in the JSON to be validated
job.setId(job.getId() != null ? job.getId() : "ok");
+ if (job.getCreateTime() == null) {
+ job.setCreateTime(new Date());
+ }
return new Request(job.build());
}
