Skip to content

grouping中有mandatory节点,但是mandatory节点的上层的 container节点的when条件不成立,还是报错了 #34

@xinghaiquedeng

Description

@xinghaiquedeng

报错:
errorTag='data-missing', severity=Error, errorPath=/test:test/test:lsps/test:lsp[test:lsp-name = 'ipv4uni'], errorMessage=missing mandatory schema node:test:uses:ipv4-conditions-type

yang模型:

/*
Copyright (C) 2019-2020 Huawei Technologies Co., Ltd. All rights reserved.
*/
module huawei-test {
  namespace "urn:huawei:yang:huawei-test";
  prefix test;
  organization
    "Huawei Technologies Co., Ltd.";
  contact
    "Huawei Industrial Base
     Bantian, Longgang
     Shenzhen 518129
     People's Republic of China
     Website: http://www.huawei.com
     Email: support@huawei.com";
  description
    "Test files for pyan.";
  revision 2020-03-24 {
    description
      "Modified some descriptions.";
    reference
      "Huawei private.";
  }
  revision 2019-03-24 {
    description
      "Initial revision.";
    reference
      "Huawei private.";
  }
  grouping ipv4-conditions-type {
    description
      "IPv4 default route matching condition configuration.";
    container default-route-match-conditions {
      when "../mode and ../mode!='null'";
      list condition {
        key "mask";
        min-elements 1;
        max-elements 4;
        description
          "Configure the matching condition for default route advertisement.";
        leaf mask {
          type uint32 {
            range "0..32";
          }
          description
            "Configure a mask that is used to match default routes.";
        }
      }
    }
  }
  
  container test {
    description
      "Configure MLDP. Query and modify MLDP parameters.";
    container lsps {
      description
        "List of Test.";
      list lsp{
        key "lsp-name";
        description
          "Configure Test.";
        leaf lsp-name {
          type string {
            length "1..31";
          }
          description
            "Test leaf LSP name.";
        }
        leaf mode {
          type string {
            length "1..31";
          }
          description
            "Test leaf LSP name.";
        }
		uses ipv4-conditions-type;
      }
    }
  }
}

数据:

<data>
    <test xmlns="urn:huawei:yang:huawei-test">
      <lsps>
        <lsp>
          <lsp-name>ipv4uni</lsp-name>
        </lsp>
      </lsps>
    </test>
 </data>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions