Skip to content
Snippets Groups Projects

Resolve "Specific paths cant be requested, because the underlying device goStruct can't be filled."

1 file
+ 4
4
Compare changes
  • Side-by-side
  • Inline
+ 4
4
@@ -94,18 +94,18 @@ func unmarshal(schema *ytypes.Schema, bytes []byte, path *gpb.Path, goStruct ygo
@@ -94,18 +94,18 @@ func unmarshal(schema *ytypes.Schema, bytes []byte, path *gpb.Path, goStruct ygo
return &errors.ErrInvalidTypeAssertion{}
return &errors.ErrInvalidTypeAssertion{}
}
}
// returns the node we want to fill with the data contained in 'bytes', using
// returns the node we want to fill with the data contained in 'bytes',
// the specified 'path'.
// using the specified 'path'.
createdNode, _, err := ytypes.GetOrCreateNode(schema.RootSchema(), validatedDeepCopy, path)
createdNode, _, err := ytypes.GetOrCreateNode(schema.RootSchema(), validatedDeepCopy, path)
if err != nil {
if err != nil {
return err
return err
}
}
fieldStruct, ok := createdNode.(ygot.ValidatedGoStruct)
validatedCreatedNode, ok := createdNode.(ygot.ValidatedGoStruct)
if !ok {
if !ok {
return &errors.ErrInvalidTypeAssertion{}
return &errors.ErrInvalidTypeAssertion{}
}
}
if err := openconfig.Unmarshal(bytes, fieldStruct, opt...); err != nil {
if err := openconfig.Unmarshal(bytes, validatedCreatedNode, opt...); err != nil {
return err
return err
}
}
Loading