[YANGTOOLS-1482] Validate ietf-restconf:yang-data substatements are unique Created: 01/Feb/23  Updated: 06/Oct/23  Resolved: 06/Oct/23

Status: Resolved
Project: yangtools
Component/s: parser
Affects Version/s: None
Fix Version/s: 12.0.0, 10.0.10, 11.0.4

Type: Improvement Priority: High
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The template name used by ietf-restconf:yang-data is supposed to be unique within an EffectiveModuleStatement, i.e. this is invalid:

 

module foo {
  import ietf-restconf { prefix rc; }

  rc:yang-data some {
    container foo;
  }

  rc:yang-data some {
    container bar;
  }
}

We should be rejecting this construct due to template name conflict. Make sure YangDataStatementSupport maintains a dedicated ParserNamespace<String, StmtCtx> keyed by the statement argument. This should be backed by NamespaceBehaviour.statementLocal() stored at the statement's parent.

Also make sure module/submodule conflicts are detected properly.


Generated at Wed Feb 07 20:56:16 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.