From 44186b3604e7bdd377701ae2ef40a13bc28aeb9e Mon Sep 17 00:00:00 2001
From: Malte Bauch <malte.bauch@stud.h-da.de>
Date: Wed, 24 Nov 2021 10:21:34 +0000
Subject: [PATCH] Resolve "Some paths of a device cant be requested more than
 once"

---
 nucleus/southbound.go | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/nucleus/southbound.go b/nucleus/southbound.go
index 9de3b15fe..a49f1c3d9 100644
--- a/nucleus/southbound.go
+++ b/nucleus/southbound.go
@@ -114,7 +114,10 @@ func unmarshal(schema *ytypes.Schema, bytes []byte, fields []string, goStruct yg
 		return err
 	}
 	ygot.PruneEmptyBranches(validatedDeepCopy)
-	return ygot.MergeStructInto(goStruct, validatedDeepCopy)
+
+	opts := []ygot.MergeOpt{&ygot.MergeOverwriteExistingFields{}}
+
+	return ygot.MergeStructInto(goStruct, validatedDeepCopy, opts...)
 }
 
 // getField traverses the GoStruct and returns the field that represents the
-- 
GitLab