You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* This commit adds support for YANG presence containers. It adds a tag to
the field of generated Go Struct. When rendering JSON documents, before
deleting/omitting empty containers, it checks for this struct field tag.
As per the OpenConfig style guide, YANG presence containers are not
used, as such this would only be used with 3rd party YANG models. As
such a CLI knob is added to generator.go to enable this behavior with
-yangpresence=true
* fix broken test case because of resync with master
* Changes Requested #1 in #645
* Adding #645 requested changes:
- adding tests in ygot/render_test.go:
- testing a presence container in a list entry (ISIS overload usecase)
- testing a presence container in a non-presence container
(system/ssh-server usecase)
- adding tests in ytypes/container_test.go:
- adding tests in TestUnmarshalContainer
* Updated minor comments in #645
Copy file name to clipboardExpand all lines: generator/generator.go
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -86,6 +86,7 @@ var (
86
86
generateRename=flag.Bool("generate_rename", false, "If set to true, rename methods are generated for lists within the Go code.")
87
87
addAnnotations=flag.Bool("annotations", false, "If set to true, metadata annotations are added within the generated structs.")
88
88
annotationPrefix=flag.String("annotation_prefix", ygen.DefaultAnnotationPrefix, "String to be appended to each metadata field within the generated structs if annoations is set to true.")
89
+
addYangPresence=flag.Bool("yangpresence", false, "If set to true, a tag will be added to the field of a generated Go struct to indicate when a YANG presence container is being used.")
89
90
generateAppend=flag.Bool("generate_append", false, "If set to true, append methods are generated for YANG lists (Go maps) within the Go code.")
90
91
generateGetters=flag.Bool("generate_getters", false, "If set to true, getter methdos that retrieve or create an element are generated for YANG container (Go struct pointer) or list (Go map) fields within the generated code.")
91
92
generateDelete=flag.Bool("generate_delete", false, "If set to true, delete methods are generated for YANG lists (Go maps) within the Go code.")
0 commit comments