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

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

Open
wants to merge 1 commit into
base: feature/lambdatesttool-v2
Choose a base branch
from

Conversation

gcbeattyAWS
Copy link

@gcbeattyAWS gcbeattyAWS 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.

@gcbeattyAWS gcbeattyAWS marked this pull request as ready for review January 13, 2025 16:58
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.

2 participants