Open lllyfeng opened 1 year ago
Do not agree with this issue. The current YANG 1.1 text is correct.
A YANG 1.0 module cannot import a YANG 1.1 module. The YANG rules for the top-level are used for all imported modules as well. New keywords like 'anydata' are not present in YANG 1.0
Close
I don't think so,andy. A YANG1.0 module has no senario to refer the YANG1.1 new keyword. The author of YANG1.0 module doesn't know any YANG1.1 new keywords, so he import a yang1.1 module( maybe it was a YANG1.0 module when it 's imported, and was updated to YANG1.1 later ) would only refer YANG1.0 keywords.
A YANG 1.0 module MUST only contain YANG 1.0 keywords and follow YANG 1.0 semantics. This may not be true if a YANG 1.0 module uses a grouping from a YANG 1.1 module. The derived schema tree MUST be YANG 1.0 if the top-level module is 1.0
In RFC7950 sec12.
I think the text above describe too much protocol specifications. It’s not YANG’s scope. Actually, for YANG 1 client, If the server supports any YANG 1.1 module, the client cannot process this situation. This has nothing to do with import.
And if a YANG version 1 module (module A)wants to import the latest version of other module (YANG version 1.1, module B), for an instance, refer a new type defined in module B, module A MUST be updated to version 1.1? But module A MAY be imported with revision by other modules, it will force other modules have to be updated to version 1.1 if the server want to support new function of module A.
So, IMO, this restriction is unnecessary. A YANG version 1 module MAY import YANG version 1.1 module by revision or without revision. It will not affect YANG unware client and YANG 1.1 client. For YANG 1 client, if server advertise YANG 1.1 modules client MAY terminate the session.