mirror of
https://github.com/beego/bee.git
synced 2024-11-26 06:21:34 +00:00
update swagger array items define
This commit is contained in:
parent
2f85185bcc
commit
3ccffe087e
10
g_docs.go
10
g_docs.go
@ -603,17 +603,17 @@ func getModel(str string) (pkgpath, objectname string, m swagger.Schema, realTyp
|
|||||||
// add type slice
|
// add type slice
|
||||||
if isSlice {
|
if isSlice {
|
||||||
mp.Type = "array"
|
mp.Type = "array"
|
||||||
mp.Properties = make(map[string]swagger.Propertie)
|
|
||||||
if isBasicType(realType) {
|
if isBasicType(realType) {
|
||||||
typeFormat := strings.Split(sType, ":")
|
typeFormat := strings.Split(sType, ":")
|
||||||
mp.Properties["items"] = swagger.Propertie{
|
mp.Items = []swagger.Propertie{{
|
||||||
Type: typeFormat[0],
|
Type: typeFormat[0],
|
||||||
Format: typeFormat[1],
|
Format: typeFormat[1],
|
||||||
}
|
}}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
mp.Properties["items"] = swagger.Propertie{
|
mp.Items = []swagger.Propertie{{
|
||||||
Ref: "#/definitions/" + realType,
|
Ref: "#/definitions/" + realType,
|
||||||
}
|
}}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if isBasicType(realType) {
|
if isBasicType(realType) {
|
||||||
|
Loading…
Reference in New Issue
Block a user