openconfig / goyang

YANG parser and compiler to produce Go language objects
Apache License 2.0
218 stars 83 forks source link

Augmenting an RPC input and output statements #247

Closed karimra closed 12 months ago

karimra commented 1 year ago

Goyang fails to parse a YANG module that augments the input (or output) statement of an RPC that was declared without input (or output) parameters. Pyang seems to implicitly create the input (or output) node if it's augmented.

Considering that the input and output statements take no arguments, should goyang create the corresponding entry nodes if they are augmented?

EDIT: From RFC6020

This node is called the augment's target node.  The
   target node MUST be either a container, list, choice, case, input,
   output, or notification node.

Meaning that the NETCONF discard-changes (of type rpc) cannot be augmented unless goyang assumes input and output exist even if not explicitly defined by the RPC.

  rpc discard-changes {
    if-feature candidate;

    description
      "Revert the candidate configuration to the current
       running configuration.";
    reference "RFC 6241, Section 8.3.4.2";
  }