Releases: openconfig/ygot
Releases · openconfig/ygot
v0.10.2
- Fix default value generation for non-singleton unions in leaf getters when
-generate_simple_unions
=true. Errors out for-generate_simple_unions
=false. ygot
now checks that the default statement's value conforms to the type's restrictions. However, note there is a goyang bug with respect to the inheritance of max and min values that makes the check overly-lenient in some cases: openconfig/goyang#128.- NOTE: Previously passing generation will now fail if there is a default statement that doesn't conform to the type restrictions. Notably,
pyang
did not catch this error forleafref
statements.
- NOTE: Previously passing generation will now fail if there is a default statement that doesn't conform to the type restrictions. Notably,
- Generate default values for decimal64 and unions correctly.
- NOTE: Previously passing generation will now fail if there is a default statement for a YANG typedef decimal64 or typedef union statement that's used as a leaf type in the compiled YANG models and
-generate_simple_unions
=false.
- NOTE: Previously passing generation will now fail if there is a default statement for a YANG typedef decimal64 or typedef union statement that's used as a leaf type in the compiled YANG models and
- Fix where unsupported types were producing non-compilable code when
-generate_simple_unions
=true. - Improve inclusiveness of codebase terminology.
v0.10.1
- [ygot merge] copyMapField and copySliceField updates dst in place instead of creating a new one. This change also fixes a bug that copyMapField is not overwriting dst (credits @chentianheng604).
- Correct a number of typos in the codebase.
v0.10.0
v0.9.0
- Add Go generator flag
ignore_shadowed_schema_paths
. When turned on, the generated Go code will ignore shadow-path values during unmarshalling of JSON or gNMI values. - Add Go generator flag
enum_suffix_for_simple_union_enums
. When turned on, inlined enumerations within non-typedef unions will have an "Enum" suffix appended. This flag will be turned on by default, and deprecated in v1.0.0. - Add protogenerator flag
consistent_union_enum_names
. When turned on, enumerations used within unions will have their names changed into a consistent form that is used by the current Go code. This flag will be turned on by default, and deprecated in v1.0.0. - Fix unmarshal's detection of invalid fields in JSON input.
- Treat
ListAttr.MaxElements=0
as "unbounded" during validation.
v0.8.12
v0.8.11
v0.8.10
v0.8.9
v0.8.8
Add -generate_simple_unions
flag for Go generation. When this flag is set, generated Go code uses a new simplified union API that makes unions much easier to work with. Instead of having to construct a unique wrapper struct or calling the To_xxx_Union("foo")
method for each union leaf, oc.UnionString("foo")
and other simple typedefs can be used to represent the union type for any union leaf that includes a string. This is now the recommended way to represent unions, and exampleoc
and uexampleoc
have been updated to reflect this.
Also in this release, the YANG binary
type can no longer be used as part of a list key in generated Go code. Any YANG list with a binary
key or a union key containing a binary
will no longer compile.