Skip to content

Commit 2c7ce1c

Browse files
ericseifertGitHub Enterprise
authored and
GitHub Enterprise
committed
[SNC-16922] Another fix for path validator (sonic-net#66)
* Path validator fix for union and identity ref cases * Go format fix * Add Balachandar's patch to fix path validator issue
1 parent 7cfbd5a commit 2c7ce1c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

translib/path_validator.go

+3
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ func (pv *pathValidator) getYangSchema() (*yang.Entry, error) {
107107
func (pv *pathValidator) getStructField(nodeName string) *reflect.StructField {
108108
var sField *reflect.StructField
109109
sval := reflect.ValueOf(pv.sValIntf).Elem()
110+
if sval.Kind() != reflect.Struct {
111+
return nil
112+
}
110113
stype := sval.Type()
111114
for i := 0; i < sval.NumField(); i++ {
112115
fType := stype.Field(i)

0 commit comments

Comments
 (0)