<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:16:38 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-1083] OpenApi returns 400 error after PUT request on toaster data</title>
                <link>https://jira.opendaylight.org/browse/NETCONF-1083</link>
                <project id="10142" key="NETCONF">netconf</project>
                    <description>&lt;p&gt;Prepared PUT request in OpenApi for &quot;yang-ext:mount/toaster2:toaster&quot; return 400 with error message &quot;Error parsing input: Choose suitable module name for element toaster:\ntoaster\ntoaster2&quot;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;img src=&quot;https://jira.opendaylight.org/secure/attachment/19003/19003_image-2023-07-12-12-47-36-248.png&quot; height=&quot;626&quot; width=&quot;907&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/span&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="37104">NETCONF-1083</key>
            <summary>OpenApi returns 400 error after PUT request on toaster data</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="ojo">Oleksandr Zharov</assignee>
                                    <reporter username="PeterSuna">Peter Suna</reporter>
                        <labels>
                            <label>pt</label>
                    </labels>
                <created>Wed, 12 Jul 2023 10:48:34 +0000</created>
                <updated>Mon, 14 Aug 2023 14:36:21 +0000</updated>
                            <resolved>Mon, 14 Aug 2023 14:36:21 +0000</resolved>
                                                    <fixVersion>7.0.0</fixVersion>
                    <fixVersion>4.0.9</fixVersion>
                    <fixVersion>5.0.8</fixVersion>
                    <fixVersion>6.0.2</fixVersion>
                                    <component>restconf-openapi</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="72405" author="petersuna" created="Wed, 19 Jul 2023 11:00:01 +0000"  >&lt;p&gt;The issue is that Json require name of the model in top container.&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; &lt;span class=&quot;code-quote&quot;&gt;&quot;toaster2:toaster&quot;&lt;/span&gt;: {
&#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;toasterSlot&quot;&lt;/span&gt;: [
&#160; &#160; &#160; {
&#160; &#160; &#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;slotId&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;Some slotId&quot;&lt;/span&gt;,
&#160; &#160; &#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;slotInfo&quot;&lt;/span&gt;: {
&#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;numberOfToastPrepared&quot;&lt;/span&gt;: 0
&#160; &#160; &#160; &#160; }
&#160; &#160; &#160; }
&#160; &#160; ],
&#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;darknessFactor&quot;&lt;/span&gt;: 0
&#160; }
} &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;To resolve this issue, it is necessary to add the module name to the top elements: `&quot;toaster: {&quot;` -&amp;gt; `&quot;toaster2:toaster: {&quot;`&lt;/p&gt;</comment>
                            <comment id="72408" author="ivanhrasko" created="Wed, 19 Jul 2023 14:50:01 +0000"  >&lt;p&gt;Interestingly &lt;b&gt;PUT /rests/data/network-topology:network-topology/topology=topology-netconf/node=17830-sim-device/yang-ext:mount/car:cars&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;with payload:&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;{
&#160; &quot;cars&quot;: {
&#160; &#160; &quot;car-entry&quot;: [
&#160; &#160; &#160; {
&#160; &#160; &#160; &#160; &quot;id&quot;: &quot;Some id&quot;,
&#160; &#160; &#160; &#160; &quot;model&quot;: &quot;Some model&quot;,
&#160; &#160; &#160; &#160; &quot;manufacturer&quot;: &quot;Some manufacturer&quot;,
&#160; &#160; &#160; &#160; &quot;year&quot;: 0,
&#160; &#160; &#160; &#160; &quot;category&quot;: &quot;Some category&quot;
&#160; &#160; &#160; }
&#160; &#160; ]
&#160; }
}&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;works well. The problem lies somewhere else.&lt;/p&gt;

&lt;p&gt;with/rests/data/network-topology:network-topology/topology=topology-netconf/node=17830-sim-device/yang-ext:mount/car:cars&lt;/p&gt;</comment>
                            <comment id="72411" author="petersuna" created="Thu, 20 Jul 2023 07:49:54 +0000"  >&lt;p&gt;It appears that this issue occurs only when there are two models with the same name of the root element within the schema context.&lt;/p&gt;

&lt;p&gt;This means that if we have two models structured like this:&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;
module test {
&#160; yang-version 1;
&#160; namespace &lt;span class=&quot;code-quote&quot;&gt;&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//netconfcentral.org/ns/test&quot;&lt;/span&gt;;
&lt;/span&gt;&#160; prefix tst;

&#160; list list {
&#160; &#160; key leaf;
&#160; &#160; leaf leaf {
&#160; &#160; &#160; type string;
&#160; &#160; }
&#160; }
}

module test2 {
&#160; yang-version 1;
&#160; namespace &lt;span class=&quot;code-quote&quot;&gt;&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//netconfcentral.org/ns/test2&quot;&lt;/span&gt;;
&lt;/span&gt;&#160; prefix tst2;

&#160; list list {
&#160; &#160; key leaf2;
&#160; &#160; leaf leaf2 {
&#160; &#160; &#160; type string;
&#160; &#160; }
&#160; }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;We must include the module name in the request body. Otherwise, requests like this will fail.&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;
curl --request PUT &lt;span class=&quot;code-quote&quot;&gt;&apos;http:&lt;span class=&quot;code-comment&quot;&gt;//localhost:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=36001-sim-device/yang-ext:mount/test:list=string&apos;&lt;/span&gt; \
&lt;/span&gt;--header &lt;span class=&quot;code-quote&quot;&gt;&apos;accept: */*&apos;&lt;/span&gt; \
--header &lt;span class=&quot;code-quote&quot;&gt;&apos;Content-Type: application/json&apos;&lt;/span&gt; \
--header &lt;span class=&quot;code-quote&quot;&gt;&apos;Authorization: Basic YWRtaW46YWRtaW4=&apos;&lt;/span&gt; \
--data &apos;{
&#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;list&quot;&lt;/span&gt;: [
&#160; &#160; &#160; &#160; {
&#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;leaf&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;
&#160; &#160; &#160; &#160; }
&#160; &#160; ]
}&apos;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Response:&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; &lt;span class=&quot;code-quote&quot;&gt;&quot;errors&quot;&lt;/span&gt;: {
&#160; &#160; &#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;error&quot;&lt;/span&gt;: [
&#160; &#160; &#160; &#160; &#160; &#160; {
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &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;,
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;error-info&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;Choose suitable module name &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; element list:\ntest2\ntest&quot;&lt;/span&gt;,
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &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: Choose suitable module name &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; element list:\ntest2\ntest&quot;&lt;/span&gt;,
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &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;
&#160; &#160; &#160; &#160; &#160; &#160; }
&#160; &#160; &#160; &#160; ]
&#160; &#160; }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="19003" name="image-2023-07-12-12-47-36-248.png" size="107637" author="PeterSuna" created="Wed, 12 Jul 2023 10:47:37 +0000"/>
                            <attachment id="19002" name="toaster2@2009-11-20.yang" size="6264" author="PeterSuna" created="Wed, 12 Jul 2023 10:47:48 +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|i045pj:</customfieldvalue>

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