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
1 changed files with 4 additions and 0 deletions

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)