openapi typescript-fetch生成非可空类型为可空

问题描述

基本上,我所有的DTO都使用可为空的字段生成,例如:id?: number;。如何为未标记为可空的类型创建不可空的类型。

我的DTO模式如下:

 "UserDTO": {
        "type": "object","properties": {
          "firstName": {
            "type": "string","nullable": true
          },"lastName": {
            "type": "string","id": {
            "type": "integer","format": "int32"
          }
        }

生成如下代码openapi-generator generate --additional-properties=prefixParameterInterfaces=true,typescriptThreePlus=true --remove-operation-id-prefix -i libs/services/defs/swagger.json -g typescript-fetch -o libs/services/src/api

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)