<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:16:24 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>[NETCONF-985] Incorrect processing of RESTCONF fields for duplicate node names on NETCONF device</title>
                <link>https://jira.opendaylight.org/browse/NETCONF-985</link>
                <project id="10142" key="NETCONF">netconf</project>
                    <description>&lt;p&gt;NetconfFieldsTranslator fails to generate the correct data tree paths for the fields parameter which includes data paths with data nodes with the same name at the same depth.&lt;/p&gt;

&lt;p&gt;For example, with the following data model:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;module foo {
  namespace &quot;urn:foo&quot;;
  prefix &quot;foo&quot;;

  container foo {
    container bar {
      leaf alpha {
        type string;
      }
      container beta {
        leaf gamma {
          type string;
        }
        leaf delta {
          type string;
        }
      }
    }

    list baz {
      key alpha;
      leaf alpha {
        type string;
      }
      container beta {
        leaf gamma {
          type string;
        }
        leaf epsilon {
          type string;
        }
      }
    }
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A request for the path &lt;tt&gt;/foo:foo&lt;/tt&gt; with the following fields parameter&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;bar(alpha;beta/gamma);baz(alpha;beta/gamma)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;generates the following NETCONF subtree filter:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;&amp;lt;filter xmlns:ns0=&quot;urn:ietf:params:xml:ns:netconf:base:1.0&quot; ns0:type=&quot;subtree&quot;&amp;gt;
    &amp;lt;foo xmlns=&quot;urn:foo&quot;&amp;gt;
        &amp;lt;bar&amp;gt;
            &amp;lt;beta&amp;gt;
                &amp;lt;gamma/&amp;gt;
            &amp;lt;/beta&amp;gt;
            &amp;lt;alpha/&amp;gt;
        &amp;lt;/bar&amp;gt;
        &amp;lt;baz/&amp;gt;
    &amp;lt;/foo&amp;gt;
&amp;lt;/filter&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Note that the request does not specify &lt;tt&gt;alpha&lt;/tt&gt; &amp;amp; &lt;tt&gt;beta/gamma&lt;/tt&gt; under &lt;tt&gt;baz&lt;/tt&gt;. Instead it is requesting the whole subtree for &lt;tt&gt;baz&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;Another request for the path &lt;tt&gt;/foo:foo&lt;/tt&gt; with the following fields parameter&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;bar(alpha;beta/delta);baz(alpha;beta/epsilon)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;returns 500 error with the following error message:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;Caused by: java.lang.IllegalArgumentException: Supplied QName (urn:foo)epsilon is not valid according to schema EmptyContainerEffectiveStatement{argument=(urn:foo)beta}, potential children nodes: [EmptyLeafEffectiveStatement{argument=(urn:foo)gamma}, EmptyLeafEffectiveStatement{argument=(urn:foo)delta}]
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:453) ~[?:?]
	at org.opendaylight.netconf.util.StreamingContext.fromSchemaAndQNameChecked(StreamingContext.java:58) ~[?:?]
	at org.opendaylight.netconf.util.StreamingContext$AbstractDataContainer.fromLocalSchema(StreamingContext.java:242) ~[?:?]
	at org.opendaylight.netconf.util.StreamingContext$AbstractDataContainer.getChild(StreamingContext.java:231) ~[?:?]
	at org.opendaylight.netconf.util.StreamingContext$AbstractComposite.getChildOperation(StreamingContext.java:207) ~[?:?]
	at org.opendaylight.netconf.util.StreamingContext$AbstractComposite.emitChildTreeNode(StreamingContext.java:189) ~[?:?]
	at org.opendaylight.netconf.util.StreamingContext$AbstractComposite.streamToWriter(StreamingContext.java:182) ~[?:?]
	at org.opendaylight.netconf.util.StreamingContext$AbstractComposite.emitChildTreeNode(StreamingContext.java:189) ~[?:?]
	at org.opendaylight.netconf.util.StreamingContext$AbstractComposite.streamToWriter(StreamingContext.java:182) ~[?:?]
	at org.opendaylight.netconf.util.StreamingContext$AbstractComposite.emitChildTreeNode(StreamingContext.java:189) ~[?:?]
	at org.opendaylight.netconf.util.StreamingContext$AbstractComposite.streamToWriter(StreamingContext.java:182) ~[?:?]
	at org.opendaylight.netconf.util.NetconfUtil.writeFilter(NetconfUtil.java:305) ~[?:?]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The error message indicates that a path generated from the fields parameter does not conform to the data model.&lt;/p&gt;

&lt;p&gt;The reason why fields parameters like this fail is because the data node identifiers are saved in a set for each depth level while processing the parameter in NetconfFieldsTranslator. Hence if there are multiple data nodes with the same name at the same depth only one of them is saved in the set, and either some of the paths are not generated (the first case) or may lead to incorrect path (the second case).&lt;/p&gt;</description>
                <environment></environment>
        <key id="36804">NETCONF-985</key>
            <summary>Incorrect processing of RESTCONF fields for duplicate node names on NETCONF device</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="10000">Done</resolution>
                                        <assignee username="sangwookha">Sangwook Ha</assignee>
                                    <reporter username="sangwookha">Sangwook Ha</reporter>
                        <labels>
                    </labels>
                <created>Tue, 28 Mar 2023 17:37:29 +0000</created>
                <updated>Thu, 1 Jun 2023 22:04:08 +0000</updated>
                            <resolved>Thu, 1 Jun 2023 22:04:08 +0000</resolved>
                                    <version>3.0.9</version>
                    <version>4.0.5</version>
                    <version>5.0.4</version>
                                    <fixVersion>6.0.0</fixVersion>
                    <fixVersion>5.0.7</fixVersion>
                    <fixVersion>4.0.8</fixVersion>
                                    <component>restconf-nb</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="72104" author="JIRAUSER13318" created="Tue, 28 Mar 2023 17:37:54 +0000"  >&lt;p&gt;The data structure used for the fields parameter (a set for each depth level) would also affect the request for MDSAL datastore but in a different way - controller may return unintended data nodes since data node at a given depth is included if its QName is included in the set for the depth.&lt;/p&gt;</comment>
                    </comments>
                    <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|i044nb:</customfieldvalue>

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