完成一版响应数据生成

This commit is contained in:
白茶清欢 2024-04-23 20:51:38 +08:00
parent 0744c5cd5b
commit db59339887

View File

@ -327,8 +327,8 @@ func generateResponseDefinitions(swaggerInfo *define.Swagger, uri string, parent
}
parentPathArr := strings.Split(parentPath, ".")
checkPath := parentPath
if len(parentPathArr) >= 2 {
checkPath = strings.Join([]string{parentPathArr[0], parentPathArr[1]}, ".")
if len(parentPathArr) >= 3 {
checkPath = strings.Join([]string{parentPathArr[0], parentPathArr[1], parentPathArr[2]}, ".")
}
subPathArr := strings.Split(subPath, ".")
if _, exist := swaggerInfo.Definitions[checkPath]; !exist && len(parentPath) > 0 {