netmod-wg / yang-next

Feature requests for future versions of YANG
6 stars 0 forks source link

Enable reusability without groupings #129

Open kwatsen opened 1 month ago

kwatsen commented 1 month ago

The "grouping" statement is great, but only if the module-designer had the foresight to create groupings, which rarely happens.

The YANG Full Embed draft attempts to address this by enabling other nodes in a module (e.g., leaf, container) to be used like a grouping.

The draft notes that such a mechanism is available in RELAX NG, Protobuf or json-schema. It might be good to review these solutions for inspiration.

If such a mechanism is considered, it might be interesting to select a node, i.e., via a schema-path, rather than assume the whole module.

abierman commented 2 weeks ago

This makes more sense if it only selected a specific top-level node instead of the entire module.

In linux terms there are 2 modes

copy mode:

     cp -R  /top  /system/source/

symlink mode

     ln -s /system/source /top

Does this feature need 2 modes? If not, how does this copy work?

abierman commented 1 week ago

Further Discuss: complexity: high, bc: unknown, importance: high

plajjan commented 1 week ago

I have needed this more than once, so I support the idea. I'm not sure if there are obstacles once we get into the hairy details of it.

I don't see why it would be limited to top level items.

Should it be possible to import the augmenting modules and get any augments to the source tree?

abierman commented 1 week ago

I also support the ability to "borrow" the schema tree for a specified node. It does not have to be the top node. That is a limitation of full-include.

This is different than Schema Mount in some ways

Lots of details to figure out