Skip to content

Commit

Permalink
fix: list api for CEA only contains get and post (#13091)
Browse files Browse the repository at this point in the history
Co-authored-by: rentu <rentu>
  • Loading branch information
SLdragon authored Jan 21, 2025
1 parent 0f09cb6 commit 6443fbf
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion packages/fx-core/src/component/generator/apiSpec/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 6443fbf

Please sign in to comment.