open-traffic-generator / snappi

Open Traffic Generator SDK in Python and Go
MIT License
70 stars 7 forks source link

Gosnappi OTG: Default values set should be handled by gosnappi for grpc #183

Open indraniBh opened 2 years ago

indraniBh commented 2 years ago

Right now, we are using following workaround in every places where api request comes as otg request (which is the case for grpc), otherwise default values are not set. Moreover it causes problem in deepEquals of two api request.


    rbody.SetMsg(in.MetricsRequest)
    m, err := rbody.ToPbText()
    if err != nil {
        result.SetStatusCode400(gosnappi.NewResponseError().SetErrors([]string{err.Error()}))
        return result.Msg(), nil
    }
    _ = rbody.FromPbText(m)```
This should be handled in go snappi.