1
0
mirror of https://github.com/beego/bee.git synced 2024-06-02 00:43:27 +00:00

Merge pull request #432 from dawxy/develop

Fixed an error in the basicType of pointer when the swagger document was automatically generated
This commit is contained in:
astaxie 2017-05-08 20:15:15 +08:00 committed by GitHub
commit a1e8589798

View File

@ -877,7 +877,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) {