Comments (3)
Hi @hellt, the code for creating the name is at https://github.com/openconfig/ygot/blob/master/gogen/goelements.go#L239
To change it you can add a new generation option and flag that would exclude the module name in the generated name.
I believe the reason it was originally included is because multiple modules can conflict. But if there is no reason to expect a conflict of top-level nodes in your YANG modules, then this would make sense. This was the decision for "compressed" generated code, so you can borrow the logic used there:
Lines 178 to 180 in 4dcc65e
from ygot.
Wen is right here -- in goyang
we build a tree per-module by creating a top-level entity named after the module's name -- the issue otherwise is that if you have ietf-interfaces
and openconfig-interfaces
on the same build then they would conflict.
from ygot.
Thank you,
I will have a look at adding a generator option to cater for smaller YANG code bases where non interfering top level containers are the norm.
In the meantime I will close the issue, as the questions has been answered.
from ygot.
Related Issues (20)
- ytypes.GetNode consumes more CPU & memory than the deprecated util.GetNode
- how to resolve the dependency for gribi HOT 2
- Diff api does generate deletes for leaf list values HOT 6
- Can enum preserve their defined values while converting yang to gostruct using openconfig/ygot\@v0.25.4/generator/generator.go ? HOT 3
- ygot.Diff don't respect presence containers HOT 9
- Preserve YANG elements order when generating structs HOT 1
- Doesn't choice and case statement in YANG result in oneof fields in proto? HOT 2
- ygot Validate error, when yang leaf type is union
- When will ygot have support for bits datatype for yang to go conversion HOT 2
- Device Returns Array for Each Interface HOT 3
- Allow ytypes.SetNode on intermediate nodes in compressed mode
- Identity Support in Ygot HOT 1
- Union field has nil value after xml.Unmarshal HOT 6
- [Question] From ygot gostruct or emittedJSON to gNMI Set Update HOT 6
- ytypes.Unmarshal() treating 50 as a float64 even though I am converting 50 to string before unmarshalling HOT 7
- How to set LeafrefOptions IgnoreMissingData for UnmarshalSetRequest HOT 2
- Can't generate OC-YANG network-instance HOT 2
- ResolveLeafrefTarget Not returning correct vlaue in case of List inside choice where list's key is a leafref HOT 2
- "default value not supported for wrapper union values" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ygot.