Skip to content

Add Integration test for verifying ApiGatewayProxyRequest format for binary content for REST api #1929

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

Merged
1 commit merged into from
Jan 15, 2025

Conversation

ghost
Copy link

@ghost ghost commented Jan 13, 2025

Issue #, if available: DOTNET-7866

Description of changes:

  • Add integration test to verify that http request to APIGatewayProxyRequest works as expected. This is done by attaching the existing REST api that is configured to the existing lambda function which returns the input event object. We then compare the expected event object with the actual object.
  • By adding this test, I have found that for REST apis with binary content, the content-length header is not in the APIGatewayProxyRequest object, so i have updated our logic to handle it.
  • I have renamed ReturnDecodedParseBinRestApi to BinaryMediaTypeRestApi since this API can be reused by multiple scenarios involving binary media with rest apis.
    • Note: In the future, I think we should probably do similar for our other api gateways in cloudformation, where we just have an api gateway for httpv1, v2, rest, and rest with binary, and then attach routes/lambdas as needed. This would reduce the amount of gateways we have.
  • I have ran all of the unit tests and integration tests after making this change and they pass.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ghost ghost marked this pull request as ready for review January 13, 2025 16:58
@ghost ghost requested review from philasmar and normj January 13, 2025 16:58
@ghost ghost merged commit 5f90129 into feature/lambdatesttool-v2 Jan 15, 2025
4 checks passed
This pull request was closed.
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.

3 participants