-
Notifications
You must be signed in to change notification settings - Fork 12
Adds json schema validator to fix issue #14 #17
Conversation
Only problem is that I couldn't figure out how to add a custom error message. So, currently it prints out all the valid timezone names if the provided timezone doesn't match the schema. |
Rather than add a dependency on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good overall, but requires an adjustment to not. break for older Framework versions cc @KillDozerX2
@@ -121,6 +122,16 @@ function convertCrontabs() { | |||
class ServerlessLocalCrontabs { | |||
constructor(serverless, options) { | |||
this.serverless = serverless; | |||
|
|||
// Create schema for your properties. For reference use https://github.com/ajv-validator/ajv | |||
this.serverless.configSchemaHandler.defineFunctionEventProperties('aws', 'schedule', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should check if this.serverless.configSchemaHandler
is defined first to avoid breaking for older Framework versions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will send PR directly then
Close in favor of: #25 |
Adds json schema validator to fix issue #14
Adds moment.js to dependencies
And changes the test-service to use local module for development