Skip to content

Commit

Permalink
temporary disable multipart
Browse files Browse the repository at this point in the history
  • Loading branch information
weidongxu-microsoft committed Dec 13, 2023
1 parent 88aa774 commit 4b7fe9a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions typespec-extension/src/code-model-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ export class CodeModelBuilder {

const convenienceApiName = this.getConvenienceApiName(operation);
let generateConvenienceApi: boolean = Boolean(convenienceApiName);
let generateProtocolApi: boolean = shouldGenerateProtocol(this.sdkContext, operation);
const generateProtocolApi: boolean = shouldGenerateProtocol(this.sdkContext, operation);

let apiComment: string | undefined = undefined;
if (generateConvenienceApi) {
Expand All @@ -668,7 +668,8 @@ export class CodeModelBuilder {
this.logWarning(apiComment);
} else if (operationIsMultipart(op)) {
// do not generate protocol method for multipart/form-data, as it be very hard for user to prepare the request body as BinaryData
generateProtocolApi = false;
codeModelOperation.internalApi = true;
generateConvenienceApi = false;
apiComment = `Protocol API requires serialization of parts with content-disposition and data, as operation '${op.operation.name}' is 'multipart/form-data'`;
this.logWarning(apiComment);
} else if (operationIsMultipleContentTypes(op)) {
Expand Down

0 comments on commit 4b7fe9a

Please sign in to comment.