We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently in ytypes/leaf.go, the gNMIToYANGTypeMatches and sanitizeGNMI functions do not support yang.Yempty.
ytypes/leaf.go
gNMIToYANGTypeMatches
sanitizeGNMI
yang.Yempty
A simple testcase to check this:
$ git diff diff --git a/ytypes/leaf_test.go b/ytypes/leaf_test.go index 8d0181a..00ce92d 100644 --- a/ytypes/leaf_test.go +++ b/ytypes/leaf_test.go @@ -1657,6 +1657,16 @@ func TestUnmarshalLeafGNMIEncoding(t *testing.T) { }, wantVal: &LeafContainerStruct{BoolLeaf: ygot.Bool(true)}, }, + { + desc: "success gNMI BoolVal to Yempty", + inSchema: typeToLeafSchema("empty-leaf", yang.Yempty), + inVal: &gpb.TypedValue{ + Value: &gpb.TypedValue_BoolVal{ + BoolVal: true, + }, + }, + wantVal: &LeafContainerStruct{EmptyLeaf: YANGEmpty(true)}, + }, { desc: "success gNMI StringVal to Ystring", inSchema: typeToLeafSchema("string-leaf", yang.Ystring),
Test result:
--- FAIL: TestUnmarshalLeafGNMIEncoding (0.00s) leaf_test.go:1848: success gNMI BoolVal to Yempty: unmarshalLeaf(&{<nil> <nil> empty-leaf [] Leaf unset <nil> unset map[] 0xc00042efc0 [] <nil> <nil> [] [] [] [] map[] [] map[] map[] <nil>}, &{<nil> [] <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> [] <nil> <nil> 0 <nil> <nil> false [] []}, bool_val:true , GNMIEncoding): got err=failed to unmarshal &{true} into empty, want err=nil E0706 17:29:38.442149 18766 util_types.go:170] unexpected type bits in yangBuiltinTypeToGoPtrType FAIL exit status 1 FAIL github.com/openconfig/ygot/ytypes 0.063s
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Currently in
ytypes/leaf.go
, thegNMIToYANGTypeMatches
andsanitizeGNMI
functions do not supportyang.Yempty
.A simple testcase to check this:
Test result:
The text was updated successfully, but these errors were encountered: