On 2021-02-22, at 10:24, Juergen Schoenwaelder <[email protected]> wrote: > > Exactly. I think we never defined this. And of course, this can get > even more fun if you consider string based encodings. The type > > type string { pattern "1|2|3|4"; } > > yields the same _XML encoded_ value space as > > type int32 { range "1..4"; } > > but as far as I recall the JSON/CBOR encodings will treat these two > differently.
We certainly called this out as expected collateral damage when we developed YANG-CBOR. So my “deductive rule of type equivalence” is not faithfully respected by YANG-CBOR. We did see a need to bow to it for unions, though. > So yes, ideally the YANG language would have clear rules > what YANG's type equivalences are. For a value of “ideal” that is closer to “fundamentally necessary” :-) Grüße, Carsten _______________________________________________ netmod mailing list [email protected] https://www.ietf.org/mailman/listinfo/netmod
