<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:16:50 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-1164] OpenAPI POST request generates incorrect XML example payload</title>
                <link>https://jira.opendaylight.org/browse/NETCONF-1164</link>
                <project id="10142" key="NETCONF">netconf</project>
                    <description>&lt;p&gt;Provided model create wrong XML payload for POST request:&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 -X &lt;span class=&quot;code-quote&quot;&gt;&apos;POST&apos;&lt;/span&gt; \
  &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/toaster-example:toaster&apos;&lt;/span&gt; \
&lt;/span&gt;  -H &lt;span class=&quot;code-quote&quot;&gt;&apos;accept: */*&apos;&lt;/span&gt; \
  -H &lt;span class=&quot;code-quote&quot;&gt;&apos;Content-Type: application/xml&apos;&lt;/span&gt; \
  -d &apos;&amp;lt;?xml version=&lt;span class=&quot;code-quote&quot;&gt;&quot;1.0&quot;&lt;/span&gt; encoding=&lt;span class=&quot;code-quote&quot;&gt;&quot;UTF-8&quot;&lt;/span&gt;?&amp;gt;
&amp;lt;toaster xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//netconfcentral.org/ns/toaster/example&quot;&lt;/span&gt;&amp;gt;
&lt;/span&gt;	&amp;lt;darknessFactor&amp;gt;0&amp;lt;/darknessFactor&amp;gt;
&amp;lt;/toaster&amp;gt;&apos; &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The correct request should be:&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 -X &lt;span class=&quot;code-quote&quot;&gt;&apos;POST&apos;&lt;/span&gt; \
  &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/toaster-example:toaster&apos;&lt;/span&gt; \
&lt;/span&gt;  -H &lt;span class=&quot;code-quote&quot;&gt;&apos;accept: */*&apos;&lt;/span&gt; \
  -H &lt;span class=&quot;code-quote&quot;&gt;&apos;Content-Type: application/xml&apos;&lt;/span&gt; \
  -d &apos;&amp;lt;?xml version=&lt;span class=&quot;code-quote&quot;&gt;&quot;1.0&quot;&lt;/span&gt; encoding=&lt;span class=&quot;code-quote&quot;&gt;&quot;UTF-8&quot;&lt;/span&gt;?&amp;gt;
&amp;lt;darknessFactor xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//netconfcentral.org/ns/toaster/example&quot;&lt;/span&gt;&amp;gt;0&amp;lt;/darknessFactor&amp;gt;&apos; &lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This issue arises because OpenAPI generates a virtual XML wrapper for all XML objects, which, in this specific case, is incorrect.&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;toaster-example_toaster&quot;&lt;/span&gt;: {
&#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;properties&quot;&lt;/span&gt;: {
&#160; &#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;darknessFactor&quot;&lt;/span&gt;: {
&#160; &#160; &#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;&quot;&lt;/span&gt;: 1000,
&#160; &#160; &#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;description&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;The darkness factor. Basically, the number of ms to multiple the doneness value by.&quot;&lt;/span&gt;,
&#160; &#160; &#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;,
&#160; &#160; &#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;example&quot;&lt;/span&gt;: 0,
&#160; &#160; &#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;format&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;int64&quot;&lt;/span&gt;,
&#160; &#160; &#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;uniqueItems&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
&#160; &#160; &#160; }
&#160; &#160; },
&#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;xml&quot;&lt;/span&gt;: {
&#160; &#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;toaster&quot;&lt;/span&gt;,
&#160; &#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;namespace&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//netconfcentral.org/ns/toaster/example&quot;&lt;/span&gt;,
&lt;/span&gt;&#160; &#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;attribute&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
&#160; &#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;wrapped&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
&#160; &#160; },
&#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;description&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;Top-level container &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; all toaster database objects.&quot;&lt;/span&gt;,
&#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;title&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;toaster-example_toaster&quot;&lt;/span&gt;,
&#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;object&quot;&lt;/span&gt;
&#160; }&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="37410">NETCONF-1164</key>
            <summary>OpenAPI POST request generates incorrect XML example payload</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="SamoSchneider">Samuel Schneider</assignee>
                                    <reporter username="PeterSuna">Peter Suna</reporter>
                        <labels>
                            <label>pt</label>
                    </labels>
                <created>Fri, 22 Sep 2023 10:34:45 +0000</created>
                <updated>Tue, 31 Oct 2023 13:12:37 +0000</updated>
                            <resolved>Tue, 31 Oct 2023 13:12:37 +0000</resolved>
                                                    <fixVersion>7.0.0</fixVersion>
                    <fixVersion>4.0.9</fixVersion>
                    <fixVersion>6.0.5</fixVersion>
                    <fixVersion>5.0.10</fixVersion>
                                    <component>restconf-openapi</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="72617" author="ivanhrasko" created="Wed, 27 Sep 2023 10:49:08 +0000"  >&lt;p&gt;&quot;OpenAPI generates a virtual XML wrapper&quot; - no, that&apos;s not an issue. The issue is that we can have only one child of creating resource in the payload. This has been fixed for lists and container in &lt;a href=&quot;https://jira.opendaylight.org/browse/NETCONF-1054&quot; title=&quot;OpenApi: POST examples are incorrect&quot; class=&quot;issue-link&quot; data-issue-key=&quot;NETCONF-1054&quot;&gt;&lt;del&gt;NETCONF-1054&lt;/del&gt;&lt;/a&gt;. Now we have to deal with leafs.&lt;/p&gt;</comment>
                            <comment id="72620" author="ivanhrasko" created="Wed, 27 Sep 2023 14:42:53 +0000"  >&lt;p&gt;We can do this for JSON but there are problems for XML that:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;We are not generating schemas for leafs - and we do not want to.&lt;/li&gt;
	&lt;li&gt;We cannot reference (via &lt;b&gt;$ref&lt;/b&gt;) something which is not in schemas.&lt;/li&gt;
	&lt;li&gt;We cannot even &quot;manually&quot; create payload as done in &lt;a href=&quot;https://jira.opendaylight.org/browse/NETCONF-1054&quot; title=&quot;OpenApi: POST examples are incorrect&quot; class=&quot;issue-link&quot; data-issue-key=&quot;NETCONF-1054&quot;&gt;&lt;del&gt;NETCONF-1054&lt;/del&gt;&lt;/a&gt; because we have no XML root element for single value.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Thus we can only eliminate this kind requests - when there is no list or container child available.&lt;/p&gt;</comment>
                            <comment id="72621" author="ivanhrasko" created="Wed, 27 Sep 2023 14:43:48 +0000"  >&lt;p&gt;Thus &lt;a href=&quot;https://jira.opendaylight.org/browse/NETCONF-1164&quot; title=&quot;OpenAPI POST request generates incorrect XML example payload&quot; class=&quot;issue-link&quot; data-issue-key=&quot;NETCONF-1164&quot;&gt;&lt;del&gt;NETCONF-1164&lt;/del&gt;&lt;/a&gt; and &lt;a href=&quot;https://jira.opendaylight.org/browse/NETCONF-1165&quot; title=&quot;OpenAPI generate multiple resources/subresources in POST request&quot; class=&quot;issue-link&quot; data-issue-key=&quot;NETCONF-1165&quot;&gt;&lt;del&gt;NETCONF-1165&lt;/del&gt;&lt;/a&gt; can be fixed by one patch.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="37411">NETCONF-1165</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="19206" name="toaster-example@2009-11-20.yang" size="651" author="PeterSuna" created="Fri, 22 Sep 2023 10:33:20 +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|i046kv:</customfieldvalue>

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