<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:54:28 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[YANGTOOLS-843] The schema path should be unique to every schema node inside the module.</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-843</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;The schema path represents unique path to every node inside module.&lt;br/&gt;
We should resolve the issue of  two nodes with  same qname and schema path, such as in a module:&lt;br/&gt;
container test {}&lt;br/&gt;
grouping test {}&lt;/p&gt;</description>
                <environment></environment>
        <key id="29047">YANGTOOLS-843</key>
            <summary>The schema path should be unique to every schema node inside the module.</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.opendaylight.org/images/icons/priorities/major.svg">Medium</priority>
                        <status id="5" iconUrl="https://jira.opendaylight.org/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10001">Won&apos;t Do</resolution>
                                        <assignee username="JieHan2017">Jie Han</assignee>
                                    <reporter username="JieHan2017">Jie Han</reporter>
                        <labels>
                    </labels>
                <created>Tue, 9 Jan 2018 01:52:03 +0000</created>
                <updated>Wed, 8 Jan 2020 23:04:02 +0000</updated>
                            <resolved>Wed, 8 Jan 2020 23:03:38 +0000</resolved>
                                                                    <component>parser</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="60624" author="jiehan2017" created="Tue, 9 Jan 2018 01:52:50 +0000"  >&lt;p&gt;&lt;a href=&quot;https://git.opendaylight.org/gerrit/66848&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/66848&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;https://git.opendaylight.org/gerrit/66850&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/66850&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="60632" author="rovarga" created="Tue, 9 Jan 2018 09:15:07 +0000"  >&lt;p&gt;I think this needs a way better description and justification. What is the precise problem we are trying to solve here?&lt;/p&gt;</comment>
                            <comment id="60633" author="rovarga" created="Tue, 9 Jan 2018 09:16:13 +0000"  >&lt;p&gt;Note that usual run-time users do not concern themselves with groupings (which really are a leak from declared model and should end up being eliminated from the effective model).&lt;/p&gt;</comment>
                            <comment id="60634" author="jiehan2017" created="Tue, 9 Jan 2018 10:52:35 +0000"  >&lt;p&gt;The problem was actually met in class ModuleContext at first,  for there&apos;re many&lt;br/&gt;
 maps which take schema path as the key, such as below:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;private final Map&amp;lt;SchemaPath,GeneratedTOBuilder&amp;gt; genTOs = new HashMap&amp;lt;&amp;gt;();&lt;br/&gt;
 private final Map&amp;lt;SchemaPath, Type&amp;gt; typedefs = new HashMap&amp;lt;&amp;gt;();&lt;br/&gt;
 private final Map&amp;lt;SchemaPath, GeneratedTypeBuilder&amp;gt; childNodes = new HashMap&amp;lt;&amp;gt;();&lt;br/&gt;
 private final BiMap&amp;lt;String, GeneratedTypeBuilder&amp;gt; dataTypes = HashBiMap.create();&lt;br/&gt;
 private final Map&amp;lt;SchemaPath, GeneratedTypeBuilder&amp;gt; groupings = new HashMap&amp;lt;&amp;gt;();&lt;br/&gt;
 private final Map&amp;lt;SchemaPath, GeneratedTypeBuilder&amp;gt; cases = new HashMap&amp;lt;&amp;gt;();&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;See the blocked issue &quot;&lt;a href=&quot;https://jira.opendaylight.org/browse/MDSAL-271&quot; title=&quot;About Namespace&quot; class=&quot;issue-link&quot; data-issue-key=&quot;MDSAL-271&quot;&gt;&lt;del&gt;MDSAL-271&lt;/del&gt;&lt;/a&gt; About Namespace&quot;: &lt;br/&gt;
&lt;a href=&quot;https://jira.opendaylight.org/browse/MDSAL-271&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.opendaylight.org/browse/MDSAL-271&lt;/a&gt;&lt;br/&gt;
in that case, all these maps above may conflicts for the same schema path but diffrent schema nodes. &lt;br/&gt;
Another case here is the implementation from uses node which is a litte complex, for example:&lt;/p&gt;

&lt;p&gt;container  test {&lt;br/&gt;
     container test {&lt;br/&gt;
     }&lt;br/&gt;
}&lt;br/&gt;
grouping test {&lt;br/&gt;
     container test {&lt;br/&gt;
     }&lt;br/&gt;
}&lt;br/&gt;
grouping test2 &lt;/p&gt;
{uses test; }

&lt;p&gt;The generated class Test for container test in grouing test2 (added by uses) would implement the class Test generated by container test in grouping test, but when we try to use an orginal schema path of the uses node to get the original node, it would find the wrong one - the inner container test in container test at the top level.&lt;br/&gt;
Such problems would always happen in many cases in the generator.&lt;/p&gt;

&lt;p&gt;Indeed that usual users don&apos;t care about the groupings but data schema nodes.&lt;br/&gt;
So we had better to provide two kinds of schema paths&#65306;&lt;br/&gt;
1) DataSchemaPath - for usual runtime users, which would try to find node from only data schema node, not groupings.&lt;br/&gt;
2) SchemaPath - for generator most, which would find node from both data schema node and groupings.&lt;br/&gt;
And as a result two APIs comes after them:&lt;br/&gt;
1) findDataSchemaNode(..., DataSchemaPath dataPath) - for usual users&lt;br/&gt;
2) findSchemaNode(..., SchemaPath schemaPath) - for generator&lt;/p&gt;</comment>
                            <comment id="60654" author="jiehan2017" created="Wed, 10 Jan 2018 00:43:21 +0000"  >&lt;p&gt;Another way to reslove this is to eliminate groupings from effective models, by then the generator would generate classes from uses nodes alone without implementations , and also it would clean everything about groupings.&lt;/p&gt;</comment>
                            <comment id="60656" author="jiehan2017" created="Wed, 10 Jan 2018 08:45:16 +0000"  >&lt;p&gt;As described in RFC7950 section 5.4:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;For example, if a module defines a grouping in which a type is&lt;br/&gt;
referenced, when the grouping is used in a second module, the type is&lt;br/&gt;
resolved in the context of the original module, not the second&lt;br/&gt;
module. There is no ambiguity if both modules define the type.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;it seems necessary to keep groupings. &lt;br/&gt;
And also for yang snippet,&lt;br/&gt;
grouping grp {&lt;br/&gt;
    leaf my-leaf {&lt;br/&gt;
          type union {&lt;br/&gt;
                 type int32;&lt;br/&gt;
                 type enumeration &lt;/p&gt;
{
                         enum &quot;unbounded&quot;;
                  }
&lt;p&gt;           }&lt;br/&gt;
}&lt;br/&gt;
The union SHOULD only be generated in grouping grp.&lt;/p&gt;</comment>
                            <comment id="60658" author="rovarga" created="Wed, 10 Jan 2018 14:17:17 +0000"  >&lt;p&gt;Well, from the overall direction at some point we should be ditching SchemaNodes in their current shape and form and we cannot really change the semantic meaning of SchemaPath &#8211; no matter how flawed it currently is, as it is used all over the place in contexts which actually work okay, as they simply do not deal with groupings and their instantiations.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Use of SchemaPath in those maps is flawed and was supposed to be fixed (note how these things are essentially copy&amp;amp;pasted from binding v1) &#8211; I would suggest binding v2 defining a SchemaNodeIdentifier for non-conflicting identification and construct the tracking maps using that. If/when that approach is qualified as sound we can promote that concept to be the replacement for SchemaPath.&lt;/p&gt;</comment>
                            <comment id="60663" author="jiehan2017" created="Thu, 11 Jan 2018 01:00:09 +0000"  >&lt;p&gt;Defining a SchemaNodeIdentifier in binding v2 would still not work, for the original schema path from uses node which was constructed by yangtools&lt;br/&gt;
was still SchemaPath by using which we still could not find the correct original schema node and then could not add class of implementation.&lt;/p&gt;</comment>
                            <comment id="60901" author="rovarga" created="Thu, 1 Feb 2018 12:47:30 +0000"  >&lt;p&gt;Right. Another question: would it be feasible to use IdentityHashMaps keyed by actual SchemaNodes? A cursory glance shows that that&apos;s how they are effective accessed...&lt;/p&gt;</comment>
                            <comment id="61025" author="jiehan2017" created="Mon, 12 Feb 2018 06:37:33 +0000"  >&lt;p&gt;In that way, APIs in yang-model-api such as UsesNode which provides getGroupingPath or AugmentationSchemaNode provides getTargetPath and so on, all these sort of nodes should also provide like  &apos;getGroupingNode&apos; or getTargetNode&apos;, in one word,  &apos;getXXXNode&apos; should appear any where getXXXPath appears.&lt;/p&gt;</comment>
                            <comment id="64533" author="rovarga" created="Fri, 3 Aug 2018 21:03:21 +0000"  >&lt;p&gt;Well, SchemaNodes are on their way out, so I do not believe we want to retrofit SchemaPath (or anything else) to fit their twisted model. EffectiveStatement is the replacement, where any statement can be addressed using a combination of:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;List&amp;lt;QName&amp;gt; along schema tree&lt;/li&gt;
	&lt;li&gt;List&amp;lt;QName&amp;gt; along data tree&lt;/li&gt;
	&lt;li&gt;Statement type + offset&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I do not believe we need addressing beyond the first two items of that list. Hence I am inclined to turn this issue into a &apos;Define StatementPath to address effective statements&apos;. Binding concerns, such as finding in what grouping a particular definition comes from should really be computed/cached in MD-SAL, not SchemaContext (and its equivalents).&lt;/p&gt;</comment>
                            <comment id="67631" author="rovarga" created="Wed, 8 Jan 2020 23:03:38 +0000"  >&lt;p&gt;This issue centers around SchemaPath, but we have an alternative in &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-738&quot; title=&quot;SchemaContext: unique SchemaNodeidentifiers&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-738&quot;&gt;&lt;del&gt;YANGTOOLS-738&lt;/del&gt;&lt;/a&gt;. The difference is that while this issue request each node to retain a global identifier (path), &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-738&quot; title=&quot;SchemaContext: unique SchemaNodeidentifiers&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-738&quot;&gt;&lt;del&gt;YANGTOOLS-738&lt;/del&gt;&lt;/a&gt; retains an identifier within the context of a parent.&lt;/p&gt;

&lt;p&gt;This effectively means that instead of having a SchemaNode-&amp;gt;Path and SchemaContext-&amp;gt;Path-&amp;gt;SchemaNode lookup we would maintain the identifier externally, if that is even useful.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                            <outwardlinks description="blocks">
                                        <issuelink>
            <issuekey id="27093">MDSAL-271</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="23158">YANGTOOLS-738</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i039cn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>