From: Martin Björklund <[email protected]>
Sent: 05 May 2020 12:39
Cc: [email protected]; [email protected]

tom petch <[email protected]> wrote:
> RFC8349 specifies an action with no input and says that modules that
> use this MUST augment the input with a leaf and that the leaf must
> be named destination-address.
>
> Is there any way that YANG can enforce either constraint?

This may look correct:

  action activate-route {
    input {
      must '*[local-name(.) = "destination-address"]';
    }
    ...
  }


.... but unfortunatly we have a CLR in the definition of "input":

   input-stmt          = input-keyword optsep
                         "{" stmtsep
                             ;; these stmts can appear in any order
                             *must-stmt
                             *(typedef-stmt / grouping-stmt)
 HERE--------------->        1*data-def-stmt
                         "}" stmtsep


We require "input" to have at least one data-def-stmt, which doens't
make any sense, since we allow an action/rpc to not define "input" at
all.

<tp>
Thanks for that.  I thought there was a reason but did not think to look there.

As you may have guessed, I just looked at a YANG module which broke the rules, 
added  a leaf but of the wrong name.

Tom Petch



/martin


>
> Tom Petch
>
>
> _______________________________________________
> netmod mailing list
> [email protected]
> https://www.ietf.org/mailman/listinfo/netmod

_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to