1
0
mirror of https://github.com/beego/bee.git synced 2024-06-16 13:53:32 +00:00

Fixed an error in the basicType of pointer when the swagger document was automatically generated

This commit is contained in:
dawxy 2017-05-05 10:53:05 +08:00
parent 1a79d6dcca
commit 2a4e01ceef

View File

@ -880,7 +880,11 @@ func typeAnalyser(f *ast.Field) (isSlice bool, realType, swaggerType string) {
}
switch t := f.Type.(type) {
case *ast.StarExpr:
return false, fmt.Sprint(t.X), "object"
basicType := fmt.Sprint(t.X)
if k, ok := basicTypes[basicType]; ok {
return false, basicType, k
}
return false, basicType, "object"
case *ast.MapType:
val := fmt.Sprintf("%v", t.Value)
if isBasicType(val) {