1
0
mirror of https://github.com/beego/bee.git synced 2024-12-24 23:30:48 +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-08 08:38:06 +08:00
parent a7ff7b8615
commit 4ef471170e

View File

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