| ___ \
| |_/ / ___ ___
| ___ \ / _ \ / _ \
| |_/ /| __/| __/
____/ ___| ___| v1.8.4
โโโ Beego : 1.8.2
โโโ GoVersion : go1.8.3
โโโ GOOS : darwin
โโโ GOARCH : amd64
โโโ NumCPU : 8
โโโ GOPATH : /Users/ag/workspace
โโโ GOROOT : /usr/local/Cellar/go/1.8.1/libexec
โโโ Compiler : gc
โโโ Date : Tuesday, 25 Jul 2017
I have a model definition as below.
type Log struct {
ID string json:"id"
Type string json:"type"
Content map[string]interface{} json:"content"
Created int64 json:"created"
Updated int64 json:"updated"
}
When I try to include this as the response object
// @Success 200 {object} controllers.LogsPaginatedResponse
It throws an error
WARN โถ 0001 Cannot find the object: 47095.0xc4204d8db0.false
It works without the interface{} field. Is there a way to store generic fields in the swagger docs.?
same issue here
@astaxie could this be solved with object types in swagger?
ๆไนๆๅๆ ท็้ฎ้ข
Yes, this is highly problematic.
A workaround is to alias the type (type newinterface = interface{} and then use newinterface on the struct), but then again, that's even more problematic. :)
Most helpful comment
Yes, this is highly problematic.
A workaround is to alias the type (type newinterface = interface{} and then use newinterface on the struct), but then again, that's even more problematic. :)