Open lllyfeng opened 1 year ago
Agree with this ticket. Clarify that it is a warning for must/when to reference unknown or removed nodes
Requires standard YANG Compiler Warnings, which should be a goal of YANG 2.0
It is not an error to have XPath that has unknown nodes. It is an error for a leafref path-stmt, but not must/when.
The YANG compiler should print a warning that the must-expr has unknown nodes in it.
XPath has rules for converting an empty node-set to a number. The expression evaluation should not cause an error.
Must Do: complexity: medium, bc: high, importance: medium
Always good to clarify, but I'm not sure I want to change XPath evaluation behavior for unknown nodes.
Support the issue to be solved.
If the schema nodes in XPath expression are un-supported by deviation, should the YANG parser report error?
If YANG parser report error, user have to also change the XPath expression by deviation (if it’s ‘when’, it can not be deviated.) If YANG parser don’t report error, the evaluation of XPath expression MAY cause unexpected result.
for example:
if using deviation to delete leaf b
YANG Parser should report error for the leaf b in must expression of leaf c not exists? if YANG parser don't report error, the evaluation of the must may always false.