Closed laopo001 closed 2 years ago
只有一个属性,它是$ref,死活生成不出来,还以为是bug。😅
一般是引用,所以就不管了
一般是引用,所以就不管了
在这种情况下,就会有问题: swagger
{
"DetailDTO": {
"title": "DetailDTO",
"type": "object",
"properties": {
"ssDTO": { "description": "aaa", "$ref": "#/components/schemas/ssDTO" },
"aDTOS": {
"type": "array",
"description": "a列表",
"items": { "$ref": "#/components/schemas/aDTO" }
},
"bDTOS": {
"type": "array",
"description": "b列表",
"items": { "$ref": "#/components/schemas/bDTO" }
}
}
},
}
理想的情况:
type DetailDTO = {
/** aaa */
ssDTO?: ssDTO;
/** a列表 */
aDTOS?: aDTO[];
/** b列表 */
bDTOS?: bDTO[];
};
实际的情况:
type DetailDTO = ssDTO;
来个pr吧
https://github.com/chenshuai2144/openapi2typescript/blob/f3888193eac104bcdf24b9d177b5a951e9b062c7/templates/interface.njk#L10