diff --git a/internal/testutil/schema.go b/internal/testutil/schema.go index c82b72f..98aa70c 100644 --- a/internal/testutil/schema.go +++ b/internal/testutil/schema.go @@ -244,7 +244,7 @@ func GNMIPath(t testing.TB, s string) *gpb.Path { t.Fatal(err) } // TODO: remove when fixed https://github.com/openconfig/ygot/issues/615 - if len(p.Elem) > 0 && p.Elem[0].Name != "meta" { + if p.Origin == "" && (len(p.Elem) == 0 || p.Elem[0].Name != "meta") { p.Origin = "openconfig" } return p diff --git a/ygnmi/gnmi.go b/ygnmi/gnmi.go index 7fb23f3..537666e 100644 --- a/ygnmi/gnmi.go +++ b/ygnmi/gnmi.go @@ -446,7 +446,7 @@ func resolvePath(q PathStruct) (*gpb.Path, error) { } // TODO: remove when fixed https://github.com/openconfig/ygot/issues/615 - if len(path.Elem) > 0 && path.Elem[0].Name != "meta" && path.Origin == "" { + if path.Origin == "" && (len(path.Elem) == 0 || path.Elem[0].Name != "meta") { path.Origin = "openconfig" }