Skip to content

[BUG] 多行字段描述导致 displayTypeLabel 生成未终止字符串 #640

@liyeyun-ai

Description

@liyeyun-ai

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

当 OpenAPI 字段 description 含多行注释(含换行与 *)且开启 isDisplayTypeLabel 时,生成的 displayTypeLabel.ts 会把描述原样放入单引号字符串,导致 TS 报 “未终止的字符串字面量”。

Expected Behavior

生成器应对多行描述做转义/清洗(如将换行替换为 \n 或空格、合并为单行),确保生成的字符串合法且不报错。

Steps To Reproduce

OpenAPI 字段 description 使用多行注释(含换行与 *)
isDisplayTypeLabel: true
运行生成
displayTypeLabel.ts 编译报错

Environment

OS: Windows
Node:v20.19.3
openapi-ts-request 版本:1.12.4
配置: isDisplayTypeLabel: true

Additional context

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions