{"action":"closed","issue":{"url":"https://api.github.com/repos/serverless/serverless/issues/1271","repository_url":"https://api.github.com/repos/serverless/serverless","labels_url":"https://api.github.com/repos/serverless/serverless/issues/1271/labels{/name}","comments_url":"https://api.github.com/repos/serverless/serverless/issues/1271/comments","events_url":"https://api.github.com/repos/serverless/serverless/issues/1271/events","html_url":"https://github.com/serverless/serverless/issues/1271","id":158624480,"number":1271,"title":"Add custom validation for plugin options","user":{"login":"pmuens","id":1606004,"avatar_url":"https://avatars.githubusercontent.com/u/1606004?v=3","gravatar_id":"","url":"https://api.github.com/users/pmuens","html_url":"https://github.com/pmuens","followers_url":"https://api.github.com/users/pmuens/followers","following_url":"https://api.github.com/users/pmuens/following{/other_user}","gists_url":"https://api.github.com/users/pmuens/gists{/gist_id}","starred_url":"https://api.github.com/users/pmuens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmuens/subscriptions","organizations_url":"https://api.github.com/users/pmuens/orgs","repos_url":"https://api.github.com/users/pmuens/repos","events_url":"https://api.github.com/users/pmuens/events{/privacy}","received_events_url":"https://api.github.com/users/pmuens/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/serverless/serverless/labels/help-wanted-easy","name":"help-wanted-easy","color":"0e8a16"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/serverless/serverless/milestones/13","html_url":"https://github.com/serverless/serverless/milestones/v1.0.0-beta.3","labels_url":"https://api.github.com/repos/serverless/serverless/milestones/13/labels","id":1945423,"number":13,"title":"v1.0.0-beta.3","description":"","creator":{"login":"flomotlik","id":132653,"avatar_url":"https://avatars.githubusercontent.com/u/132653?v=3","gravatar_id":"","url":"https://api.github.com/users/flomotlik","html_url":"https://github.com/flomotlik","followers_url":"https://api.github.com/users/flomotlik/followers","following_url":"https://api.github.com/users/flomotlik/following{/other_user}","gists_url":"https://api.github.com/users/flomotlik/gists{/gist_id}","starred_url":"https://api.github.com/users/flomotlik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flomotlik/subscriptions","organizations_url":"https://api.github.com/users/flomotlik/orgs","repos_url":"https://api.github.com/users/flomotlik/repos","events_url":"https://api.github.com/users/flomotlik/events{/privacy}","received_events_url":"https://api.github.com/users/flomotlik/received_events","type":"User","site_admin":false},"open_issues":26,"closed_issues":73,"state":"open","created_at":"2016-08-16T16:37:00Z","updated_at":"2016-09-02T10:50:31Z","due_on":"2016-09-02T00:00:00Z","closed_at":null},"comments":3,"created_at":"2016-06-06T08:25:50Z","updated_at":"2016-09-02T10:50:31Z","closed_at":"2016-09-02T10:50:31Z","body":"Apart from marking options as required with the `required` keyword it should also be possible to add a customValidation entry in the plugins options so that e.g. the PluginManager can check against a regular expression.\r\n\r\n```\r\nclass Create {\r\n  constructor() {\r\n    this.commands = {\r\n      create: {\r\n        usage: 'create new Serverless Service.',\r\n        lifecycleEvents: [\r\n          'create',\r\n        ],\r\n        options: {\r\n          stage: {\r\n            usage: '--stage dev',\r\n            required: true\r\n          }\r\n          region: {\r\n            usage: '--region us-east-1',\r\n            customValidation: /.*/\r\n          }\r\n        }\r\n      },\r\n    };\r\n  }\r\n```"}}
{"actor":{"display_login":"flomotlik"}}