On Thu, 2018-11-22 at 14:39 +0100, Martin Bjorklund wrote: > Hi, > > Ladislav Lhotka <lho...@nic.cz> wrote: > > Andy Bierman <a...@yumaworks.com> writes: > > > > > On Mon, Nov 19, 2018 at 12:32 PM Sterne, Jason (Nokia - CA/Ottawa) < > > > jason.ste...@nokia.com> wrote: > > > > > > > Hi all, > > > > > > > > > > > > > > > > If we have a YANG model with a leaf: > > > > > > > > > > > > > > > > MODEL VERSION 1: > > > > > > > > container my-model { > > > > > > > > leaf a { type string; } > > > > > > > > } > > > > > > > > > > > > > > > > And then later we produce another version of the model where that leaf > > > > is > > > > placed into a choice construct: > > > > > > > > > > > > > > > > MODEL VERSION 2: > > > > > > > > container my-model { > > > > > > > > choice some-choice { > > > > > > > > case x { > > > > > > > > leaf a { type string; } > > > > > > > > } > > > > > > > > } > > > > > > > > } > > > > > > > > > > > > > > > > Is that considered a non-backwards-compatible change? > > > > > > > > > > yes -- even though the data node /my-model/x did not change, > > > the schema node /my-model/a changed to /my-model/some-choice/x/a. > > > Any leafref path pointing at this leaf will break. > > > > This is not correct. A leafref path is a special XPath, and as such > > includes only data nodes, i.e. NOT choice and case nodes. > > > > What does change are schema node identifier. This could be significant > > in an augment statement, but not ini this example because a leaf cannot > > be augmented anyway. > > > > I don't see anything else that could break, so Jason's change seems > > backward compatible to me. > > Since it does change the schema tree, this is not legal according to > 7950. So in that sense it is not backwards compatible. The rules in > 7950 protect both clients and other modules that import the module.
Section 11 does not explicitly forbid changes that change schema node identifiers. On the other hand, it contains this item: o Any set of data definition nodes may be replaced with another set of syntactically and semantically equivalent nodes. For example, a set of leafs may be replaced by a "uses" statement of a grouping with the same leafs. I think this applies nicely to the current case: the modified schema is arguably semantically equivalent to the old one. Lada > > /martin > > > > > Lada > > > > > > > > Andy > > > > > > > > > > Does the answer depend on whether the choice contains other cases (or > > > > other cases that are the default case)? > > > > > > > > > > > > > > > > > > no > > > > > > > > > > MODEL VERSION 3: > > > > > > > > container my-model { > > > > > > > > choice some-choice { > > > > > > > > case x { > > > > > > > > leaf a { type string; } > > > > > > > > } > > > > > > > > case y { > > > > > > > > leaf b { type string; } > > > > > > > > } > > > > > > > > } > > > > > > > > } > > > > > > > > > > > > > > > > A client 'foo' using VERSION 1 would still be able to set & read back > leaf > > > > a in the same way as it always did. > > > > > > > > > > > > > > > > But if another client 'bar' (using VERSION 3) sets leaf 'b', then leaf > 'a' > > > > would disappear. That could be surprising to client 'foo' although > perhaps > > > > no more surprising than if another client simply deletes leaf 'a' (using > > > > VERSION 1). > > > > > > > > > > > > > > > > Jason > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > netmod mailing list > > > > netmod@ietf.org > > > > https://www.ietf.org/mailman/listinfo/netmod > > > > > > > _______________________________________________ > > > netmod mailing list > > > netmod@ietf.org > > > https://www.ietf.org/mailman/listinfo/netmod > > > > -- > > Ladislav Lhotka > > Head, CZ.NIC Labs > > PGP Key ID: 0xB8F92B08A9F76C67 > > > > _______________________________________________ > > netmod mailing list > > netmod@ietf.org > > https://www.ietf.org/mailman/listinfo/netmod > > -- Ladislav Lhotka Head, CZ.NIC Labs PGP Key ID: 0xB8F92B08A9F76C67 _______________________________________________ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod