netmod-wg / yang-next

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

allow notifications/actions to appear in invalid contexts #84

Open kwatsen opened 5 years ago

kwatsen commented 5 years ago

For example, RFC 7950 Section 7.16 says:

  A notification MUST NOT be defined within an rpc, action, or another
  notification, i.e., a notification node MUST NOT have an rpc, action,
  or a notification node as one of its ancestors in the schema tree.
  For example, this means that it is an error if a grouping that
  contains a notification somewhere in its node hierarchy is used in an
  rpc definition.

But sometimes a grouping contains a notification or an action, and thus is currently disqualified from being used inside (in this case) a notification.

Ideally such cases would be ignored, perhaps generating a warning.

In the meanwhile, per this discussion, we may create a "data-only" version of every grouping containing an action or notification solely to work around this constraint.

abierman commented 2 weeks ago

Support these changes but they may be complicated to implement. The compiler would skip these nodes during uses-stmt processing.

Complexity: medium, bc: high, importance: medium

kwatsen commented 19 minutes ago

Why is it complex to skip nodes during uses-stmt processing?

importance high IMO, since the fallback is not good.