소스 검색

🐛 fix(documents): 修复preserveFormatting参数类型转换问题

- 使用z.coerce.boolean()确保preserveFormatting参数能正确从字符串转换为布尔值
- 解决非布尔类型输入导致的参数解析错误
yourname 2 달 전
부모
커밋
c3b2a58986
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/server/api/documents/merge/post.ts

+ 1 - 1
src/server/api/documents/merge/post.ts

@@ -16,7 +16,7 @@ const MergeRequestSchema = z.object({
     description: '输出格式',
     example: 'docx'
   }),
-  preserveFormatting: z.boolean().default(true).openapi({
+  preserveFormatting: z.coerce.boolean().default(true).openapi({
     description: '是否保持原有格式',
     example: true
   })