lib/plugins/aws/invokeLocal/index.js/AwsInvokeLocal/extendedValidate
class AwsInvokeLocal:  extendedValidate() {
    this.validate();

    // validate function exists in service
    this.options.functionObj = this.serverless.service.getFunction(this.options.function);
    this.options.data = this.options.data || '';

    return new BbPromise(resolve => {
      if (this.options.contextPath) {
        this.validateFile(this.options.contextPath, 'context');
      }

      if (this.options.data) {
        resolve();
      } else if (this.options.path) {
        this.validateFile(this.options.path, 'data');

        resolve();
      } else {
        try {
          stdin().then(input => {
            this.options.data = input;
            resolve();
          });
        } catch (exception) {
          // resolve if no stdin was provided
          resolve();
        }
      }
    }).then(() => {
      try {
        // unless asked to preserve raw input, attempt to parse any provided objects
        if (!this.options.raw) {
          if (this.options.data) {
            this.options.data = JSON.parse(this.options.data);
          }
          if (this.options.context) {
            this.options.context = JSON.parse(this.options.context);
          }
        }
      } catch (exception) {
        // do nothing if it's a simple string or object already
      }
    });
  }