How to set at least one of the child's presence as constraint for a list

Hi,

I have following yang model.

list condition-map {
    key name;
    ordered-by user;
    leaf name {
         type string {
         length "1..32";
    }
    leaf-list condition1 {
         ordered-by user;
         type string;
    }
    leaf-list condition2 {
         ordered-by user;
         type uint32;
    }
}

What I want to do with condition-map is, at least one of condition1 and condition2 should be present for the condition-map to be a valid entry. How do I set this constraint?

Anyone has any ideas for this one?

Following must statement is one way to do it:

list condition-map {
  key name;
  ordered-by user;
  leaf name {
    type string {
      length "1..32";
    }
    must "../condition1 or ../condition2" {
      error-message "Either condition1 or condition2 has to be present";
    }
  }
  leaf-list condition1 {
    ordered-by user;
    type string;
  }
  leaf-list condition2 {
    ordered-by user;
    type uint32;
  }
}