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

fix(aws, apigateway): make StatusCode property compliant with AWS-documented types #7977

Merged
merged 2 commits into from
Jul 27, 2020
Merged

fix(aws, apigateway): make StatusCode property compliant with AWS-documented types #7977

merged 2 commits into from
Jul 27, 2020

Conversation

Undre4m
Copy link
Contributor

@Undre4m Undre4m commented Jul 23, 2020

For AWS::ApiGateway::Method resources, make MethodResponse and IntegrationResponse StatusCode property type-compliant with AWS-documented types to avoid validation errors on compiled CloudFormation templates.

Closes: #7970

…umented types for AWS::ApiGateway::Method objects
@codecov-commenter
Copy link

codecov-commenter commented Jul 23, 2020

Codecov Report

Merging #7977 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #7977   +/-   ##
=======================================
  Coverage   88.13%   88.13%           
=======================================
  Files         242      242           
  Lines        9146     9146           
=======================================
  Hits         8061     8061           
  Misses       1085     1085           
Impacted Files Coverage Δ
...ompile/events/apiGateway/lib/method/integration.js 98.24% <ø> (ø)
.../compile/events/apiGateway/lib/method/responses.js 100.00% <ø> (ø)

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 e68e116...0a4803e. 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 @Undre4m ! Please check my suggestion

@@ -159,7 +159,7 @@ module.exports = {
);

const integrationResponse = {
StatusCode: parseInt(statusCode, 10),
StatusCode: parseInt(statusCode, 10).toString(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's just put statusCode (note that in original code string is converted to number, instead of reconverting obtained number to string, let's just not convert to number)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right! Missed that 👍

@@ -36,7 +36,7 @@ module.exports = {
const methodResponse = {
ResponseParameters: {},
ResponseModels: {},
StatusCode: parseInt(statusCode, 10),
StatusCode: parseInt(statusCode, 10).toString(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

@Undre4m Undre4m requested a review from medikoo July 24, 2020 14:28
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 @Undre4m !

@medikoo medikoo merged commit d0edb5d into serverless:master Jul 27, 2020
@Undre4m Undre4m deleted the fix/7970-aws-statusCode-type branch July 27, 2020 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type validation mismatch for StatusCode in AWS::ApiGateway::Method response objects
3 participants