Skip to content
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

fix: list api for CEA only contains get and post #13091

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading