Skip to content

Commit 42ea5f8

Browse files
committed
fix: augmentations within same yang module without when statements valid
1 parent d7c5e48 commit 42ea5f8

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

  • yangkit-model-impl/src/main/java/org/yangcentral/yangkit/model/impl/stmt

yangkit-model-impl/src/main/java/org/yangcentral/yangkit/model/impl/stmt/AugmentImpl.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,12 @@ protected ValidatorResult validateSelf() {
336336
if(this.getWhen() != null){
337337
severity = Severity.WARNING;
338338
}
339-
validatorResultBuilder.addRecord(
340-
ModelUtil.reportError(mandatoryDescendant,severity, ErrorTag.BAD_ELEMENT,
341-
ErrorCode.AUGMENT_MANDATORY_NODE.getFieldName()));
339+
// If augmentation is in different module than the target
340+
if (!mandatoryDescendant.getContext().getCurModule().equals(this.target.getContext().getCurModule())) {
341+
validatorResultBuilder.addRecord(
342+
ModelUtil.reportError(mandatoryDescendant,severity, ErrorTag.BAD_ELEMENT,
343+
ErrorCode.AUGMENT_MANDATORY_NODE.getFieldName()));
344+
}
342345

343346
}
344347

0 commit comments

Comments
 (0)