完成一版响应数据生成

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, ".") parentPathArr := strings.Split(parentPath, ".")
checkPath := parentPath checkPath := parentPath
if len(parentPathArr) >= 2 { if len(parentPathArr) >= 3 {
checkPath = strings.Join([]string{parentPathArr[0], parentPathArr[1]}, ".") checkPath = strings.Join([]string{parentPathArr[0], parentPathArr[1], parentPathArr[2]}, ".")
} }
subPathArr := strings.Split(subPath, ".") subPathArr := strings.Split(subPath, ".")
if _, exist := swaggerInfo.Definitions[checkPath]; !exist && len(parentPath) > 0 { if _, exist := swaggerInfo.Definitions[checkPath]; !exist && len(parentPath) > 0 {