<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:16:52 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-1178] POST request with insert parameter fails if target URI points the list</title>
                <link>https://jira.opendaylight.org/browse/NETCONF-1178</link>
                <project id="10142" key="NETCONF">netconf</project>
                    <description>&lt;p&gt;POST requests inherently operate on parent resources in the path. This makes it impossible to utilize the `insert` query parameter in the desired manner.&lt;br/&gt;
When the parent resource root (which is a container) is used, the application assigns the insert parameter to the container, rather than to the child list items which we intend to update.&lt;br/&gt;
Example&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;curl --location --request POST &apos;http://localhost:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=17830-sim-device/yang-ext:mount/user-ordered-list:root?insert=last&apos; \
--header &apos;Accept: application/json&apos; \
--header &apos;Content-Type: application/json&apos; \
--header &apos;Authorization: Basic YWRtaW46YWRtaW4=&apos; \
--header &apos;Cookie: JSESSIONID=node01orql8nxe3xvz18848b91d7c1z1.node0&apos; \
--data-raw &apos;{
&#160; &quot;user-ordered-list:items&quot;: [
&#160; &#160; {
&#160; &#160; &#160; &quot;id&quot;: 1,
&#160; &#160; &#160; &quot;name&quot;: &quot;name&quot;
&#160; &#160; }
&#160; ]
}&apos;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Error Received:&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;{
    &quot;errors&quot;: {
        &quot;error&quot;: [
            {
                &quot;error-tag&quot;: &quot;bad-element&quot;,
                &quot;error-message&quot;: &quot;Insert parameter can be used only with list or leaf-list&quot;,
                &quot;error-type&quot;: &quot;protocol&quot;
            }
        ]
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A similar situation arises when using a list as the parent resource. In this case, the application assigns the insert parameter to the parent list and demands an ordered-by-user statement.&lt;/p&gt;</description>
                <environment></environment>
        <key id="37434">NETCONF-1178</key>
            <summary>POST request with insert parameter fails if target URI points the list</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="3" iconUrl="https://jira.opendaylight.org/images/icons/statuses/inprogress.png" description="This issue is being actively worked on at the moment by the assignee.">In Progress</status>
                    <statusCategory id="4" key="indeterminate" colorName="yellow"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="SamoSchneider">Samuel Schneider</assignee>
                                    <reporter username="yaroslav.lastivka">Yaroslav Lastivka</reporter>
                        <labels>
                            <label>pick-next</label>
                            <label>pt</label>
                    </labels>
                <created>Thu, 5 Oct 2023 11:46:21 +0000</created>
                <updated>Fri, 24 Nov 2023 09:06:42 +0000</updated>
                                                            <fixVersion>7.0.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="72801" author="JIRAUSER13216" created="Wed, 15 Nov 2023 12:42:41 +0000"  >&lt;p&gt;seems copy paste issue from PUT case&lt;/p&gt;

&lt;p&gt;see &lt;a href=&quot;https://github.com/opendaylight/netconf/blob/b1944fc75ac63a62dfb23d061263392796742680/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/transactions/RestconfStrategy.java#L386&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;RestconfStrategy.java#L386&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;the path already points to parent element, no reason taking parent of parent, &lt;br/&gt;
the inserted item path value expected to be calculated based on URI path value, not takes as is.&lt;br/&gt;
the subsequent logic #insertAndCommitPost() should be updated accordingly.&lt;/p&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="37408">NETCONF-1163</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="37438">NETCONF-1180</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="37433">NETCONF-1177</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="19223" name="user-ordered-list@2023-10-04.yang" size="643" author="yaroslav.lastivka" created="Thu, 5 Oct 2023 13:56:25 +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|i046ov:</customfieldvalue>

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