Hi all,

I saw the addition of empty types in list keys in YANG 1.1 but had troubles 
finding more details in the NETMOD list.  Is it discussed in the YANG 1.1 
issues page (and if so, where is that now ?  I tried an old link and it didn't 
work) ?

If I take this example where I have a set of a apartments 1,2,3 but there may 
also be occasional 'bis' apartments (e.g. 7bis).

list apartment {
    key "number bis";
    leaf number {
        type int16;
    }
    leaf bis {
        type empty;
    }
    leaf description {
         type string;
    }
}

Can I create list entries like this ?

<apartment>
    <number>5</number>
    <description>apartment 5</description>
<apartment>
<apartment>
    <number>8</number>
    <bis/>
    <description>apartment 8bis</description>
<apartment>
<apartment>
    <number>8</number>
    <description>apartment 8</description>
<apartment>

Doesn't the empty type have two states and the absence/presence of the leaf/tag 
indicates those states ?

I realize that a Boolean type could be used for bis but the use case (a 
question of preference/style) is that 'bis' is unusual and so it becomes noisy 
to have to set <bis>false</bis> all the time when creating apartment entries.  
It may be useful to only have to specify <bis/> in the rare cases that it is 
needed.

Regards,
Jason

_______________________________________________
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to