如何解决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 举报,一经查实,本站将立刻删除。