Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ di.annotate(factory,
'Services.Environment',
'Services.Waterline',
'TaskOption.Validator',
di.Injector
di.Injector,
'Sanitizer'
)
);

Expand All @@ -43,7 +44,8 @@ function factory(
env,
waterline,
validator,
injector
injector,
sanitizer
) {

var TaskStates = Constants.Task.States;
Expand Down Expand Up @@ -304,6 +306,7 @@ function factory(
//TODO: Remove the judgement and enable the code block after task-schema is fully
//ready
if (self.schema) {
sanitizer.decrypt(self.options);
validator.validate(self.definition.schemaRef, self.options);
}
})
Expand Down Expand Up @@ -447,6 +450,7 @@ function factory(
//Do schema validation but skip the option that requires context because the
//full context is not ready right now.
try {
sanitizer.decrypt(self.options);
validator.validateContextSkipped(self.definition.schemaRef, self.options);
}
catch (err) {
Expand Down