Skip to content

Conversation

@Yossi-kerner
Copy link
Contributor

When creating a lambda which have many http triggers, we generate the same operationId to all of them.
The solution here is to add the method to the end of the operationId making it unique.

Object.entries(path).forEach(([methodName, method]) => {
const httpEvent = this.functions[method.operationId]?.events?.find(
(e: ApiGatewayEvent) => e.http
(e: ApiGatewayEvent) => (e.http as any).method === methodName
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Typescript-wise e.http could be string so TS cried but I see in the next lines we used it as an object so I did that.

@Yossi-kerner Yossi-kerner merged commit 647b42e into main Nov 16, 2022
@razbensimon razbensimon deleted the chore-handle-http-events-list branch November 16, 2022 10:13
Yossi-kerner added a commit that referenced this pull request Nov 16, 2022
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.

2 participants