Skip to content

Commit

Permalink
[SNC-16922] Another fix for path validator (sonic-net#66)
Browse files Browse the repository at this point in the history
* Path validator fix for union and identity ref cases

* Go format fix

* Add Balachandar's patch to fix path validator issue
  • Loading branch information
ericseifert authored and GitHub Enterprise committed Feb 24, 2022
1 parent 7cfbd5a commit 2c7ce1c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions translib/path_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ func (pv *pathValidator) getYangSchema() (*yang.Entry, error) {
func (pv *pathValidator) getStructField(nodeName string) *reflect.StructField {
var sField *reflect.StructField
sval := reflect.ValueOf(pv.sValIntf).Elem()
if sval.Kind() != reflect.Struct {
return nil
}
stype := sval.Type()
for i := 0; i < sval.NumField(); i++ {
fType := stype.Field(i)
Expand Down

0 comments on commit 2c7ce1c

Please sign in to comment.