I have an XML file:
<a>
<b>true</b>
<c>foo</c>
</a>
and a Yang model:
container a {
leaf b {
type boolean;
}
leaf c {
type string;
}
}
Node 'c' is mandatory only when node 'b' equals 'true'. If I add a mandatory: true constraint to node 'c' it will become mandatory for all values of 'b'.
How to change the Yang model so that node 'c' is mandatory when 'b' is 'true' and optional when 'b' is false?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…