From fb450177dc68100c5202b0e4fb0d673c9d045d1b Mon Sep 17 00:00:00 2001 From: rentu Date: Tue, 21 Jan 2025 15:54:35 +0800 Subject: [PATCH] fix: list api for CEA only contains get and post --- .../src/component/generator/apiSpec/helper.ts | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/fx-core/src/component/generator/apiSpec/helper.ts b/packages/fx-core/src/component/generator/apiSpec/helper.ts index 9ceabca19a..7f5b7900e6 100644 --- a/packages/fx-core/src/component/generator/apiSpec/helper.ts +++ b/packages/fx-core/src/component/generator/apiSpec/helper.ts @@ -119,6 +119,25 @@ export function getParserOptions( allowConversationStarters: true, allowConfirmation: false, // confirmation is not stable for public preview in Sydney, so it's temporarily set to false } + : type === ProjectType.TeamsAi + ? { + allowAPIKeyAuth: true, + allowBearerTokenAuth: true, + allowMultipleParameters: true, + allowOauth2: true, + projectType: ProjectType.TeamsAi, + allowMethods: [ + "get", + "post", + "put", + "delete", + "patch", + "head", + "connect", + "options", + "trace", + ], + } : { projectType: type, allowBearerTokenAuth: !!platform && platform === Platform.VS ? false : true, // Currently, API key auth support is actually bearer token auth @@ -1077,7 +1096,7 @@ function parseSpec(spec: OpenAPIV3.Document): [SpecObject[], boolean] { if (pathItem) { const operations = pathItem; for (const method in operations) { - if (method === "get" || method === "post") { + if (ConstantString.AllOperationMethods.includes(method)) { const operationItem = (operations as any)[method] as OpenAPIV3.OperationObject; if (operationItem) { const authResult = Utils.getAuthArray(operationItem.security, spec);