From 36027acfddf998b6a1072b0a7862868fede5286c Mon Sep 17 00:00:00 2001 From: Chris Barbour Date: Sun, 22 Dec 2024 13:08:24 +0000 Subject: [PATCH] fixing integrations --- src/cli/generators/middy/templates/middy-templates.ts | 2 +- src/open-api-builder.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cli/generators/middy/templates/middy-templates.ts b/src/cli/generators/middy/templates/middy-templates.ts index f0191d8..96890b8 100644 --- a/src/cli/generators/middy/templates/middy-templates.ts +++ b/src/cli/generators/middy/templates/middy-templates.ts @@ -12,7 +12,7 @@ export function handlerMethodType(method: Method): string { export function route(path: Path, method: Method): string { return `{ method: '${method.method.toUpperCase()}', - path: '/{stage}${path.pathString()}', + path: '${path.pathString()}', handler: this.${method.operationId}() }`; } diff --git a/src/open-api-builder.ts b/src/open-api-builder.ts index 563921b..4f44578 100644 --- a/src/open-api-builder.ts +++ b/src/open-api-builder.ts @@ -73,10 +73,10 @@ export class OpenApiSpecificationBuilder< } get awsLambdaApiGatewayIntegration(): Record { - const schemes = this.parts.schemes.reduce((prev, key) => { + const apiIntegrations = this.parts.apiIntegrations.reduce((prev, key) => { return {...prev, [key]: {"$ref": `#/components/x-amazon-apigateway-integrations/${key}`}} },{} as any) as any; - return schemes; + return apiIntegrations; } withPath(name: string, builder: (path: PathBuilder, oas: this) => PathBuilder): this {