openconfig / ygot

A YANG-centric Go toolkit - Go/Protobuf Code Generation; Validation; Marshaling/Unmarshaling
Apache License 2.0
286 stars 106 forks source link

Error on yang file with anyxml #469

Open jnpr-tjiang opened 4 years ago

jnpr-tjiang commented 4 years ago

go run ~/go/src/github.com/openconfig/ygot/generator/generator.go -path=yang -output_file=ems_regional_types.go -package_name=ems_regional_types -shorten_enum_leaf_names -typedef_enum_with_defmod -exclude_modules=ietf-interfaces ems-regional.yang F1027 11:47:19.486916 69976 generator.go:348] ERROR Generating GoStruct Code: unknown type of entry Directory in findMappableEntities for /ems-regional/device-family/platform

Here is the anyxml element that caused the issue. If I commented this anyxml node, everything is fine:

292 list platform { 293 key "platform_name"; 294 description¬ 295 "List of hardware platform in this device family"; 296 leaf platform_name { 297 type string; 298 description 299 "Hardware platform or model name, such as NFX-250, etc."; 300 } 301 anyxml hardware_catalog { 302 description 303 "JSON or XML data to specify the hardware catalog for this 304 specific hard platform."; 305 } 306 }

wenovus commented 4 years ago

ygot currently doesn't support anyxml nodes, but these nodes should be ignored rather than erroring out.

wenovus commented 1 year ago

The flag -ignore_unsupported can be used to ignore unsupported nodes such as notifications and anyxml.