Skip to content

Commit 6d3a55a

Browse files
chore: clean code
1 parent b7dd4d7 commit 6d3a55a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/generator/serviceGenarator.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -966,10 +966,8 @@ export default class ServiceGenerator {
966966
isAnonymous: false,
967967
};
968968

969-
// 具名 body 场景
970-
if (isReferenceObject(schema)) {
971-
bodySchema.type = `${bodySchema.type}`;
972-
} else {
969+
// 匿名 body 场景
970+
if (!isReferenceObject(schema)) {
973971
bodySchema.isAnonymous = true;
974972
}
975973

@@ -1070,7 +1068,7 @@ export default class ServiceGenerator {
10701068
DEFAULT_SCHEMA) as SchemaObject;
10711069
}
10721070

1073-
responseSchema.type = `${this.getType(schema, this.config.namespace)}`;
1071+
responseSchema.type = this.getType(schema, this.config.namespace);
10741072

10751073
return responseSchema;
10761074
}

0 commit comments

Comments
 (0)