Swagger for import-exoprt

This commit is contained in:
breel
2020-07-25 20:20:12 -06:00
parent 09507d38e9
commit b423adde4a
8 changed files with 350 additions and 32 deletions

View File

@@ -81,7 +81,16 @@ func (o One) MarshalBSON() ([]byte, error) {
default:
return nil, fmt.Errorf("bad connections type %T", m[Connections])
}
delete(connections, "")
for k := range connections {
if k == "" {
continue
}
if o.Connections[k].Name == "" {
p := o.Connections[k]
p.Name = k
o.Connections[k] = p
}
b, err := bson.Marshal(o.Connections[k])
if err != nil {
return nil, err