feat: add pointer type

Signed-off-by: Ziyi Zhang <soasurs@outlook.com>
This commit is contained in:
Ziyi Zhang 2022-04-11 14:25:08 +08:00
parent 0d58de711b
commit 9aa450eafd
No known key found for this signature in database
GPG Key ID: C2923A8334802AD9

View File

@ -10,11 +10,17 @@ import (
var swaggerMapTypes = map[string]reflect.Kind{ var swaggerMapTypes = map[string]reflect.Kind{
"string": reflect.String, "string": reflect.String,
"*string": reflect.String,
"int": reflect.Int, "int": reflect.Int,
"*int": reflect.Int,
"int32": reflect.Int, "int32": reflect.Int,
"*int32": reflect.Int,
"uint32": reflect.Int, "uint32": reflect.Int,
"*uint32": reflect.Int,
"uint64": reflect.Int64, "uint64": reflect.Int64,
"*uint64": reflect.Int64,
"int64": reflect.Int64, "int64": reflect.Int64,
"*int64": reflect.Int64,
"[]string": reflect.Slice, "[]string": reflect.Slice,
"[]int": reflect.Slice, "[]int": reflect.Slice,
"[]int64": reflect.Slice, "[]int64": reflect.Slice,
@ -22,9 +28,13 @@ var swaggerMapTypes = map[string]reflect.Kind{
"[]uint32": reflect.Slice, "[]uint32": reflect.Slice,
"[]uint64": reflect.Slice, "[]uint64": reflect.Slice,
"bool": reflect.Bool, "bool": reflect.Bool,
"*bool": reflect.Bool,
"struct": reflect.Struct, "struct": reflect.Struct,
"*struct": reflect.Struct,
"float32": reflect.Float32, "float32": reflect.Float32,
"*float32": reflect.Float32,
"float64": reflect.Float64, "float64": reflect.Float64,
"*float64": reflect.Float64,
} }
// http://swagger.io/specification/#infoObject // http://swagger.io/specification/#infoObject