Previously, there is a bug #114, which fixed schema node identifier in deviation resolving from the same module.
But recently, we found when a deviation reference is point to a schema node from another module, then the resolving in deviation failed again.
When loading above test data, 'lf1' will be reported as an error, due to failed to find 'lf1' schema node.
If we change 'unique lf1' to 'unique ygtest:lf1', then there will be no error.
It indicates that it was trying to find 'lf1' in current local module 'bug_114_ext'. But that is not right.
Here in deviation/deviate, the prefix is not mandatory needed. See Example in RFC 7950
deviation /base:system {
deviate delete {
must "daytime or time";
}
}
Personally, I also prefer to have a prefix, that would be much clear and better.
In deviation/deviate, the correct scope should inherit from the same scope of the deviation reference target (some schema node, whatever in the same module of deviation or some other modules)
My proposal is to enhance ScopeContextProvider when computeScope of Deviation and its children.
Meanwhile, it might need to force to resolve some SchemaNodeIdentifier's container ScopeContext during getEObject(String uriFragement, ...) in YangResource
Previously, there is a bug #114, which fixed schema node identifier in deviation resolving from the same module. But recently, we found when a deviation reference is point to a schema node from another module, then the resolving in deviation failed again.
When loading above test data, 'lf1' will be reported as an error, due to failed to find 'lf1' schema node. If we change 'unique lf1' to 'unique ygtest:lf1', then there will be no error. It indicates that it was trying to find 'lf1' in current local module 'bug_114_ext'. But that is not right.
Personally, I also prefer to have a prefix, that would be much clear and better.
My proposal is to enhance ScopeContextProvider when computeScope of Deviation and its children. Meanwhile, it might need to force to resolve some SchemaNodeIdentifier's container ScopeContext during getEObject(String uriFragement, ...) in YangResource