netmod-wg / yang-next

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

Co-existence between YANG1.0 and YANG1.1 #118

Open lllyfeng opened 1 year ago

lllyfeng commented 1 year ago

In RFC7950 sec12.

   A YANG version 1 module or submodule MUST NOT import a YANG
   version 1.1 module by revision.
   If a YANG version 1 module A imports module B without revision and
   module B is updated to YANG version 1.1, a server MAY implement both
   of these modules (A and B) at the same time.  In such cases, a
   NETCONF server MUST advertise both modules using the rules defined in
   Section 5.6.4, and SHOULD advertise module A and the latest revision
   of module B that is specified with YANG version 1 according to the
   rules defined in [RFC6020].

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.

abierman commented 1 week 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

lllyfeng commented 1 week ago

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.

abierman commented 1 week ago

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