Closed vcshox closed 5 years ago
You're correct, it's just that I have yet to come up with a good way of dealing with feature
statements...
It's supposed to denote an external condition outside of the schema and data. The problem is, we need to have this external state known at the time when we eval
the schema with data. One possibility is to pass in this information at the time of parse
itself. Another way would be to enable the bind
operation dealing with feature
specially to perform the relationship enforcement. A different way would be to allow configuration state of the Yang
parser itself to become aware of the external feature availability state (such as Yang.use
syntax).
Let me know if any suggestions.
The latest yang-js enforces if-feature
by checking if the referenced feature
has a .binding
when the schema is being eval
. If it finds that the feature
does not contain any binding, the parent node containing the if-feature
will be removed from the resulting data model.
It seems that
container c
is always active whenfeature-bar
is "on", no matter whatfeature-foo
is. According to RFC if-feature, I think theif-feature
in afeature
should influence its effectiveness