<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:16:17 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-937] Error writing values with XML YANG Patch</title>
                <link>https://jira.opendaylight.org/browse/NETCONF-937</link>
                <project id="10142" key="NETCONF">netconf</project>
                    <description>&lt;p&gt;Invoking &lt;b&gt;YANG Patch&lt;/b&gt; with &lt;b&gt;XML&lt;/b&gt; payload (PATCH &lt;a href=&quot;http://192.168.56.25:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=17830-sim-device/yang-ext:mount/instance-identifier-patch-module:patch-cont/my-list1=leaf1):&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://192.168.56.25:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=17830-sim-device/yang-ext:mount/instance-identifier-patch-module:patch-cont/my-list1=leaf1):&lt;/a&gt;&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&amp;lt;yang-patch xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;urn:ietf:params:xml:ns:yang:ietf-yang-patch&quot;&lt;/span&gt;&amp;gt;
&amp;lt;patch-id&amp;gt;test-patch&amp;lt;/patch-id&amp;gt;
&amp;lt;comment&amp;gt;&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; is test patch&amp;lt;/comment&amp;gt;
&amp;lt;edit&amp;gt;
    &amp;lt;edit-id&amp;gt;edit1&amp;lt;/edit-id&amp;gt;
    &amp;lt;operation&amp;gt;replace&amp;lt;/operation&amp;gt;
    &amp;lt;target&amp;gt;/my-leaf11&amp;lt;/target&amp;gt;
    &amp;lt;value&amp;gt;
        &amp;lt;my-leaf11&amp;gt;my-leaf11 :: XML value&amp;lt;/my-leaf11&amp;gt;
    &amp;lt;/value&amp;gt;
&amp;lt;/edit&amp;gt;
&amp;lt;/yang-patch&amp;gt; &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Results in error and leaf value is not written:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
{
  &lt;span class=&quot;code-quote&quot;&gt;&quot;errors&quot;&lt;/span&gt;: {
    &lt;span class=&quot;code-quote&quot;&gt;&quot;error&quot;&lt;/span&gt;: [
      {
        &lt;span class=&quot;code-quote&quot;&gt;&quot;error-tag&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;malformed-message&quot;&lt;/span&gt;,
        &lt;span class=&quot;code-quote&quot;&gt;&quot;error-message&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;Error parsing input: &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;&quot;&lt;/span&gt;,
        &lt;span class=&quot;code-quote&quot;&gt;&quot;error-type&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;protocol&quot;&lt;/span&gt;
      }
    ]
  }
}&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Corresponding payload in &lt;b&gt;JSON works&lt;/b&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="36514">NETCONF-937</key>
            <summary>Error writing values with XML YANG Patch</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.opendaylight.org/images/icons/priorities/critical.svg">High</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="PeterSuna">Peter Suna</assignee>
                                    <reporter username="PeterSuna">Peter Suna</reporter>
                        <labels>
                            <label>pt</label>
                    </labels>
                <created>Wed, 4 Jan 2023 17:08:58 +0000</created>
                <updated>Tue, 24 Jan 2023 12:56:53 +0000</updated>
                            <resolved>Tue, 24 Jan 2023 12:56:53 +0000</resolved>
                                                    <fixVersion>5.0.1</fixVersion>
                                    <component>restconf-nb</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="71810" author="ivanhrasko" created="Thu, 5 Jan 2023 12:25:26 +0000"  >&lt;p&gt;&lt;b&gt;XmlPatchBodyReader&lt;/b&gt; contains redundant if condition which is not in &lt;b&gt;JsonPatchBodyReader&lt;/b&gt;.&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (schemaNode &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; &#160;ContainerSchemaNode || schemaNode &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; ListSchemaNode) {
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; NormalizedNodeResult resultHolder = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; NormalizedNodeResult();
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; NormalizedNodeStreamWriter writer = ImmutableNormalizedNodeStreamWriter.from(resultHolder);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; XmlParserStream xmlParser = XmlParserStream.create(writer, inference);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; xmlParser.traverse(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; DOMSource(firstValueElement));
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; parsed = resultHolder.getResult();
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; parsed = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; } &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This if condition causes that &lt;b&gt;ChoiceSchemaNode, LeafListSchemaNode, etc.&lt;/b&gt; will not be parsed:&lt;br/&gt;
&lt;a href=&quot;https://github.com/opendaylight/netconf/blob/master/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/XmlPatchBodyReader.java#L144&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/opendaylight/netconf/blob/master/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/XmlPatchBodyReader.java#L144&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;JsonPatchBodyReader&lt;/b&gt; does not contain this condition before parsing patch value:&lt;br/&gt;
&lt;a href=&quot;https://github.com/opendaylight/netconf/blob/master/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/JsonPatchBodyReader.java#L259&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/opendaylight/netconf/blob/master/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/JsonPatchBodyReader.java#L259&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/opendaylight/netconf/blob/master/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/JsonPatchBodyReader.java#L375&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/opendaylight/netconf/blob/master/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/JsonPatchBodyReader.java#L375&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Therefore, this condition in &lt;b&gt;XmlPatchBodyReader&lt;/b&gt; is redundant and should be &lt;b&gt;removed&lt;/b&gt;.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="18401" name="instance-identifier-patch-module@2015-11-21.yang" size="868" author="ivanhrasko" created="Thu, 5 Jan 2023 12:37:57 +0000"/>
                    </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|i043wf:</customfieldvalue>

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