Closed soumiksamanta closed 5 years ago
Hi, no there isn't a knob as the current code also operates on paths without the module prefixes since there are no conflicts.
Is it ok for you to strip the module prefixes? In the current code there are the helpers StripModulePrefix
and StripModulePrefixesStr
which you can make use of.
Thanks! I strip the modulename from the path elements. But I still feel that it would be great if the ygot library does it internally for me. Similar to what today EmitJSON does, ex. pass the option of AppendModuleName, disable Validation etc.
ygot@v0.6.0
I am trying to create a golang app on similar grounds as provided in https://github.com/google/gnxi/blob/master/gnmi/server_test.go
In all the gNMI SET test scenarios in the above test file, the setRequest uses path without the moduleName prepended. I want to use the following Path to do a gnmi SET txtPbPath :=
elem: <name: "openconfig-platform:component" >
If I use the above path which includes modulename, I get error from ygot "could not find path in tree beyond type model.Device, remaining path openconfig-platform:component"
The reason for this is the following code snippet from https://github.com/openconfig/ygot/blob/master/experimental/ygotutils/common.go
The method only looks at the path tag from the generated GoStruct Is there a knob, where the module tag is also included and its not stripped off?