Skip to content

APIGateway Example Doesn't Build #473

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

Closed
mikaelacaron opened this issue Jan 28, 2025 · 2 comments
Closed

APIGateway Example Doesn't Build #473

mikaelacaron opened this issue Jan 28, 2025 · 2 comments
Assignees
Labels
area/testing Improvements to tests. good first issue Good for newcomers kind/bug Feature doesn't work as expected. semver/none No version bump required.

Comments

@mikaelacaron
Copy link

mikaelacaron commented Jan 28, 2025

the example for the APIGateway doesn't build, because the initializer doesn't have encodableBody as one of the properties

In main.swift of APIGateway example, link

return try APIGatewayV2Response(statusCode: .ok, headers: header, encodableBody: event)

This is the error:

 error: extra argument 'encodableBody' in call
25 | 
26 |     // echo the request in the response
27 |     return try APIGatewayV2Response(statusCode: .ok, headers: header, encodableBody: event)
   |                                                                                      `- error: extra argument 'encodableBody' in call
@sebsto sebsto self-assigned this Jan 29, 2025
@sebsto sebsto added kind/bug Feature doesn't work as expected. good first issue Good for newcomers semver/none No version bump required. area/testing Improvements to tests. labels Jan 29, 2025
@sebsto
Copy link
Contributor

sebsto commented Jan 29, 2025

Hello @mikaelacaron Thank you for reporting this.
This is a recent change in the AWS Lambda Event library.

Are you sur spm picked up the correct version and not a local cached copy ?

I would suggest to delete .build and Package.resolved and try again.

rm -rf .build Package.resolved  
swift build

...

Building for debugging...
[2/2] Write swift-version--644A47CB88185983.txt
Build complete! (1.73s)

@mikaelacaron
Copy link
Author

now it works after deleting the .build folder and Package.resolved

I had tried swift package resolve and that didn't fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing Improvements to tests. good first issue Good for newcomers kind/bug Feature doesn't work as expected. semver/none No version bump required.
Projects
None yet
Development

No branches or pull requests

2 participants