Skip to content

Commit

Permalink
skip flatten for application/merge-patch+json
Browse files Browse the repository at this point in the history
  • Loading branch information
weidongxu-microsoft committed Mar 5, 2024
1 parent 4f7fe46 commit b1cee81
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion typespec-extension/src/code-model-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1325,13 +1325,18 @@ export class CodeModelBuilder {
// anonymous model

// name the schema for documentation
schema.language.default.name = op.language.default.name + "Request";
schema.language.default.name = pascalCase(op.language.default.name) + "Request";

if (!parameter.language.default.name) {
// name the parameter for documentation
parameter.language.default.name = "request";
}

if (operationIsJsonMergePatch(httpOperation)) {
// skip model flatten, if "application/merge-patch+json"
return;
}

this.trackSchemaUsage(schema, { usage: [SchemaContext.Anonymous] });

if (op.convenienceApi && op.parameters) {
Expand Down

0 comments on commit b1cee81

Please sign in to comment.