On Mon, Oct 2, 2017 at 6:15 AM, JOEY BOYD <[email protected]> wrote:
> Hello, > > Does anyone have thoughts on this? > The choice and case nodes are schema nodes so they are never an issue for data tree XPath such as must/when. The change works in your example because a leaf cannot be augmented. If it was container and some other module augmented it, that module will break if the container is changed to a choice. > > Regards, > Joey > Andy > > -----Original Message----- > From: JOEY BOYD > Sent: Wednesday, September 27, 2017 9:06 AM > To: '[email protected]' > Subject: Backward Compatibility Question > > Hi all, > > Suppose I had a published YANG model with the following leaf. > > > leaf thing1 { > type uint8; > description > "Thing 1."; > } > > Later, I realize that I wish I had modeled this in a choice as I now have > a mutually exclusive option to 'thing1' which I want to add to the model. > > leaf thing2 { > type empty; > description > "Thing 2."; > } > > This is a very simplified example but should be sufficient to demonstrate > the problem. > > If I look at the XML representation of 'thing1', it looks like this. > > <thing1>123</thing1> > > If I were to move 'thing1' into a choice with a single case, it would look > like this. > > choice things { > case thing1 { > leaf thing1 { > type uint8; > description > "Thing 1."; > } > } > } > > Looking to the XML representation, it looks the same as before. > > <thing1>123</thing1> > > To me, this means that taking a single node or set of nodes and moving > them under a case within a new choice statement is a backward compatible > change. This assumes, of course, any mandatory or default behavior is > preserved. I now can add 'thing2' to the existing model as an option to > 'thing1'. > > choice things { > case thing1 { > leaf thing1 { > type uint8; > description > "Thing 1."; > } > } > case thing2 { > leaf thing2 { > type empty; > description > "Thing 2."; > } > } > } > > Do you agree with this analysis or am I missing something? > > Best regards, > Joey > > _______________________________________________ > netmod mailing list > [email protected] > https://www.ietf.org/mailman/listinfo/netmod >
_______________________________________________ netmod mailing list [email protected] https://www.ietf.org/mailman/listinfo/netmod
