Open abierman opened 5 months ago
What happens if the string matches multiple definitions?
If we allow leaving out prefixes in situations where there is no ambiguity, should we not do this systematically and not just in when/must expressions? Having to remember where I am allowed to leave out prefixes and where not may make it harder to write proper YANG. (I do not know whether any good language servers exist for YANG but tools like that can also take care of getting the details straight.)
I guess we did insist on unambiguous identifiers to prevent situations where an update of an imported module suddenly causes name clashes in importing modules. So it is a question of convenience vs. robustness; if you don't like surprises, better use fully qualified names.
Agree to close this issue. Leaving out the prefix is a common issue. In general we should make YANG easier to use. This would change the meaning of a missing prefix.
Close: complexity: medium, bc: low, importance: low
Problem
There are several YANG modules that have must/when XPath that compares an identityref leaf to a string literal.
The strict rules in the RFC (sec 9.10) say that the identity (e.g. PROT_OTN) MUST be defined in the current module.
This is often not done.
Solution