Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(aws): add schema for alexaSkill #8290

Merged

Conversation

pgrzesik
Copy link
Contributor

Adds schema definition for alexaSkill event.

In addition, it also adds deprecation for defining alexaSkill with just an alexaSkill string. That configuration is not covered by schema as it would require a rewrite of current utility for defining event schemas. Related discussion in corresponding issue.

Closes: #8023

@codecov-commenter
Copy link

codecov-commenter commented Sep 25, 2020

Codecov Report

Merging #8290 into master will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8290      +/-   ##
==========================================
- Coverage   88.18%   88.16%   -0.02%     
==========================================
  Files         250      250              
  Lines        9398     9391       -7     
==========================================
- Hits         8288     8280       -8     
- Misses       1110     1111       +1     
Impacted Files Coverage Δ
...ins/aws/package/compile/events/alexaSkill/index.js 96.29% <0.00%> (-3.71%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2eebf51...2e6f0e4. Read the comment docs.

Copy link
Contributor

@medikoo medikoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @pgrzesik looks very good! I've proposed just one minor style improvement

].join('');
throw new this.serverless.classes.Error(errorMessage);
}
} else if (typeof event.alexaSkill === 'object') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it's a last acceptable form, we may simplify this to } else { (it'll be nice also because typeof x === 'object' feels quirky (e.g. null passes such condition))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call, changed 👍

Copy link
Contributor

@medikoo medikoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @pgrzesik !

@medikoo medikoo merged commit 7f47448 into serverless:master Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Config schema: Define AWS "alexaSkill" function event properties
3 participants