Skip to content

Commit

Permalink
fix: 修复requestBody中properties属性键值存在特殊符号导致报错解析文件失败 (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
lovewinders authored Nov 15, 2023
1 parent a853798 commit 2a9fd23
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/serviceGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,8 @@ class ServiceGenerator {
? Object.keys(schemaObject.properties).map((propName) => {
const schema: SchemaObject =
(schemaObject.properties && schemaObject.properties[propName]) || DEFAULT_SCHEMA;
// 剔除属性键值中的特殊符号,因为函数入参变量存在特殊符号会导致解析文件失败
propName = propName.replace(/[\[|\]]/g, '');
return {
...schema,
name: propName,
Expand Down

0 comments on commit 2a9fd23

Please sign in to comment.