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(apigatewayv2): WebSocketAwsIntegration ignores requestParameters #28859

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ webSocketApi.addRoute('$connect', {
integrationUri: `arn:aws:apigateway:${stack.region}:dynamodb:action/PutItem`,
integrationMethod: HttpMethod.POST,
credentialsRole: apiRole,
requestParameters: {
Copy link
Contributor

@GavinZZ GavinZZ Jan 26, 2024

Choose a reason for hiding this comment

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

@FayezX This won't be enough unfortunately, you'll need to build this change and run yarn integ <path-to-this-file> --update-on-failed to update the snapshots as well.

Copy link
Author

Choose a reason for hiding this comment

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

Hey Gavin, I think i will need assistance on this. Unfortunately I don't know this library very well. Can you help out please?

Copy link
Contributor

Choose a reason for hiding this comment

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

npx lerna run build --scope=@aws-cdk-testing/framework-integ
cd packages/@aws-cdk-testing/framework-integ
yarn integ test/aws-apigatewayv2-integrations/test/websocket/integ.aws.js --update-on-failed

Copy link
Author

Choose a reason for hiding this comment

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

I am having some typescript compilation issues and the commands fail for me. Please feel free to add to the pr as you see fit.

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that the command itself is not working. Try yarn integ --update-on-failed instead and it should work for you.

Copy link
Author

Choose a reason for hiding this comment

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

running the command yarn integ --update-on-failed gives me yarn integ --update-on-failed Error: Cannot find module './integ-runner.js'. The command seems to be trying to run /packages/@aws-cdk/integ-runner/bin/integ-runner but cannot find the ./integ-runner.js file and fails.

'integration.request.header.Content-Type': 'application/json'
},
requestTemplates: {
'application/json': JSON.stringify({
TableName: table.tableName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export class WebSocketAwsIntegration extends WebSocketRouteIntegration {
uri: this.props.integrationUri,
method: this.props.integrationMethod,
credentialsRole: this.props.credentialsRole,
requestParameters: this.props.requestParameters,
requestTemplates: this.props.requestTemplates,
templateSelectionExpression: this.props.templateSelectionExpression,
};
Expand Down