networkop / yang-to-cue

Importing YANG definitions into CUE
9 stars 2 forks source link

Error while generating go types #1

Open frederic-loui opened 1 year ago

frederic-loui commented 1 year ago

Hi,

Like you approach you exposed [here]()https://networkop.co.uk/post/2022-12-cue-yang/ I'm following your README.md And basically, the following errors occurs during step 3.

I understand that this is more related to ygot, in that case please let me know and I'll create an issue there. If just in case you have a good grasp of what's happening there, feel free to suggest ! :)

Thanks !

generator -path=openconfig -generate_fakeroot -fakeroot_name=device -output_file=pkg/yang.go -compress_paths=false -exclude_modules=ietf-interfaces,openconfig-mpls,openconfig-isis,openconfig-evpn -include_descriptions=false -include_model_data=false
 -package_name=yang openconfig/release/models/interfaces/openconfig-if-ip.yang openconfig/release/models/bgp/openconfig-bgp.yang openconfig/release/models/network-instance/openconfig-network-instance.yang yang/arista.yang
F0618 15:53:56.540445    7211 generator.go:382] ERROR Generating GoStruct Code: path "/openconfig-network-instance/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/weighted-ecmp/config/load-balancing-weight": default value not supported for wrapper union values, please generate using simplified union leaves
networkop commented 1 year ago

it looks like what is says: "default value not supported for wrapper union values"

image

You can try removing the default value to see if the generation is successful. Most likely it's just not implemented in ygot and might require a PR in their repo.