corenova / yang-js

YANG parser and composer
Apache License 2.0
56 stars 18 forks source link

require-instance of type instance-identifier #65

Closed vcshox closed 6 years ago

vcshox commented 7 years ago

In the following example: schema:

module schema {
  prefix "schema";
  container c {
    leaf l1 {
      type string;
    }
  }

  leaf l2 {
    type instance-identifier;
}

data:

{
  "schema:c":{
    "l1":"ABC"
  },
  "schema:l2":"/schema:c/l1"
}

yang-js works fine when I eval the data.

Nevertheless, when I add sub-statement require-instance (no matter true or false) and eval, yang-js always throws an error.

Is there a bug or maybe I misunderstood the RFC?

sekur commented 7 years ago

Hi @vcshox - I'll take a closer look next week, it's been a busy week. :-)

vcshox commented 7 years ago

@saintkepha Thank you!!