So would it be a fair summary to say that it is allowed to change from a specific type to a union consisting only of those types, but that adding different types on top of the existing type is not recommended.
Which JSON document are you referring to? Thanks, William -----Original Message----- From: Juergen Schoenwaelder [mailto:j.schoenwael...@jacobs-university.de] Sent: 19 April 2016 09:12 To: William Ivory <wiv...@brocade.com> Cc: netmod@ietf.org Subject: Re: [netmod] Question about updating YANG modules On Tue, Apr 19, 2016 at 08:02:24AM +0000, William Ivory wrote: > OK - but changing from int8 to int16 still allows all previously > allowed values, and simply adds some more, making it less restrictive. > That isn't allowed though as noted in the bullet point from section 10 > below. Obviously, the set of allowed values changes when you replace int8 with int16. > What about extending a union that previously included say just strings to > include int8 as well - is that allowed under section 10 rules? This is an interesting question. Assuming you had leaf a { type string; } and you change it to leaf a { type union { type int8; type string; } } then for the XML encoding the set of values does not change however for the JSON encoding it does change. See the JSON document for subtleties associated with unions. To prevent damage for encodings that carry some type information, we might need a stricter interpretation of YANG compatibility rules... /js -- Juergen Schoenwaelder Jacobs University Bremen gGmbH Phone: +49 421 200 3587 Campus Ring 1 | 28759 Bremen | Germany Fax: +49 421 200 3103 <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.jacobs-2Duniversity.de_&d=CwIBAg&c=IL_XqQWOjubgfqINi2jTzg&r=GByLeg9jZvOv_AlgBo9uvdDrxizlOR7l_SnTXowyJU8&m=wSZwDXcoblI354__Ryu63C-eCizA9MGZlpaNGr9oamA&s=zU0Z5HyUEKygBVYhh9EtdPH-AfQ7IeFuMllqL3wEWs0&e= > _______________________________________________ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod