#1 is an empty list (or leaf-list).  This is what you want.

#2 is a list containing one element, which is an empty container (or, in Python 
term's, an empty 'dict').

Yanglint 1.x used to accept #1, kinks are being worked out on the 2.x branch.

Kent // contributor


> On Mar 29, 2022, at 10:21 AM, Jack Rickard 
> <[email protected]> wrote:
> 
> Hi,
>  
> I think I’ve found an ambiguity in RFC 7951, and I’d like your input on what 
> was intended and what the best behaviour to exhibit is.
>  
> Section 5.3 and 5.4 of RFC 7951 - JSON Encoding of Data Modeled with YANG 
> (ietf.org) <https://datatracker.ietf.org/doc/html/rfc7951#section-5.3> 
> describe the encoding of leaf-lists and lists, however it’s unclear how an 
> empty list should be encoded. Should it be encoded as:
> An empty array: {“list”: []}
> A missing field: {}
>  
> I’ve seen libraries go either way, libyang only accepts 2 but the python 
> yangson library accepts both (I’m not sure which is the default).
>  
> Thanks,
> Jack Rickard 
> he/him 
> Software Engineer 
> [email protected] <mailto:[email protected]> 
> 
> <image001.png>
>  
>  
> _______________________________________________
> netmod mailing list
> [email protected] <mailto:[email protected]>
> https://www.ietf.org/mailman/listinfo/netmod 
> <https://www.ietf.org/mailman/listinfo/netmod>
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to