openconfig / ygot

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

Silently dropping leaf in ietf-routing model #605

Open ccakes opened 3 years ago

ccakes commented 3 years ago

I think I've found an issue with ygot in YANG models that have an augment inside a uses. I've greated a repo with a reproduction case here - https://github.com/ccakes/ygot-uses-augment

In short, this augment doesn't seem to be picked up by ygot and the resulting Go code is missing the next-hop-address leaf.

https://github.com/ccakes/ygot-uses-augment/blob/5129adbf6c6991d5cb7b74626ddc1941792cc48c/ietf-ipv4-unicast-routing%402018-03-13.yang#L99-L111

pyang detects it fine and as far as I can tell it's valid YANG. Any ideas?

wenovus commented 3 years ago

I believe this is due to goyang not processing "augment" statements inside "uses" statements at all. Is it possible for you to change this to a module-level augment to work around this? I can take a look at a fix this week.

ccakes commented 3 years ago

Thanks for the quick response! I've done that in the interim but would love to stick to the IETF models if I can. Whenever a fix is possible would be appreciated 👍

ianbarrere commented 4 days ago

@wenovus do you know if this is still a limitation? The IOS-XR models use lots of augments inside uses blocks, and I am unfortunately stuck with using them in a few cases.

wenovus commented 4 days ago

I'm currently not working on ygot anymore, but I believe it still is. @robshakir