mirror of
https://github.com/beego/bee.git
synced 2024-11-21 23:50:54 +00:00
Merge pull request #595 from maxshine/develop
Fix swagger docs missing schema attr for primitive body type param
This commit is contained in:
commit
6f1ff54713
@ -791,10 +791,21 @@ func setParamType(para *swagger.Parameter, typ string, pkgpath, controllerName s
|
||||
if typ == "string" || typ == "number" || typ == "integer" || typ == "boolean" ||
|
||||
typ == astTypeArray || typ == "file" {
|
||||
paraType = typ
|
||||
if para.In == "body" {
|
||||
para.Schema = &swagger.Schema{
|
||||
Type: paraType,
|
||||
}
|
||||
}
|
||||
} else if sType, ok := basicTypes[typ]; ok {
|
||||
typeFormat := strings.Split(sType, ":")
|
||||
paraType = typeFormat[0]
|
||||
paraFormat = typeFormat[1]
|
||||
if para.In == "body" {
|
||||
para.Schema = &swagger.Schema{
|
||||
Type: paraType,
|
||||
Format: paraFormat,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
m, mod, realTypes := getModel(typ)
|
||||
para.Schema = &swagger.Schema{
|
||||
|
Loading…
Reference in New Issue
Block a user