<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:16:33 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-1054] OpenApi: POST examples are incorrect</title>
                <link>https://jira.opendaylight.org/browse/NETCONF-1054</link>
                <project id="10142" key="NETCONF">netconf</project>
                    <description>&lt;p&gt;Issue A: Currently, ODL OpenApi generates examples for POST requests which contain all configuration children in payload.&lt;/p&gt;

&lt;p&gt;This is not correct for both XML and JSON because we cannot create multiple resources with POST request.&lt;/p&gt;

&lt;p&gt;Issue B: We can try to remove all data but the key from payload and we get working example for JSON:&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;
POST /rests/data/network-topology:network-topology/topology=topology-id &lt;/pre&gt;
&lt;/div&gt;&lt;/div&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;topology-id&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;topology-id&quot;&lt;/span&gt;
} &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;But even this approach does not work for XML, for example:&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;
POST /rests/data/network-topology:network-topology/topology=topology-id  &lt;/pre&gt;
&lt;/div&gt;&lt;/div&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;?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;topology xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;urn:TBD:params:xml:ns:yang:network-topology&quot;&lt;/span&gt;&amp;gt;
&#160; &#160; &amp;lt;topology-id xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;urn:TBD:params:xml:ns:yang:network-topology&quot;&lt;/span&gt;&amp;gt;topology-id&amp;lt;/topology-id&amp;gt;
&amp;lt;/topology&amp;gt; &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Because Swagger UI automatically encloses child into topology element (what&apos;s correct behavior for XML payloads).&lt;/p&gt;

&lt;p&gt;Instead we should just POST one child as follows:&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;?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;topology-id xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;urn:TBD:params:xml:ns:yang:network-topology&quot;&lt;/span&gt;&amp;gt;Some topology-id&amp;lt;/topology-id&amp;gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Solution: POST payloads should contains only the key (lists with key) or empty body (lists without key or containers). Issue B will be addressed separately.&lt;/p&gt;</description>
                <environment></environment>
        <key id="37005">NETCONF-1054</key>
            <summary>OpenApi: POST examples are incorrect</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="1" iconUrl="https://jira.opendaylight.org/images/icons/priorities/blocker.svg">Highest</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="yaroslav.lastivka">Yaroslav Lastivka</assignee>
                                    <reporter username="ivanhrasko">Ivan Hrasko</reporter>
                        <labels>
                            <label>pt</label>
                    </labels>
                <created>Tue, 13 Jun 2023 10:32:08 +0000</created>
                <updated>Tue, 12 Sep 2023 14:21:10 +0000</updated>
                            <resolved>Fri, 8 Sep 2023 08:19:59 +0000</resolved>
                                                    <fixVersion>7.0.0</fixVersion>
                    <fixVersion>4.0.9</fixVersion>
                    <fixVersion>5.0.8</fixVersion>
                    <fixVersion>6.0.2</fixVersion>
                    <fixVersion>6.0.3</fixVersion>
                                    <component>restconf-openapi</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="72431" author="ivanhrasko" created="Wed, 2 Aug 2023 12:35:51 +0000"  >&lt;p&gt;It has been proven that we do not need to create cumbersome separate logic to create empty containers and lists but instead we can use schema for the first child of the container/list.&lt;/p&gt;

&lt;p&gt;There are two cases:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;The first child is a container, see diff between&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://jira.opendaylight.org/secure/attachment/19009/19009_original2.json&quot; title=&quot;original2.json attached to NETCONF-1054&quot;&gt;original2.json&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://jira.opendaylight.org/images/icons/link_attachment_7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt; and &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://jira.opendaylight.org/secure/attachment/19010/19010_expected-container-POST.json&quot; title=&quot;expected-container-POST.json attached to NETCONF-1054&quot;&gt;expected-container-POST.json&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://jira.opendaylight.org/images/icons/link_attachment_7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;The first child is a list, see diff between &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://jira.opendaylight.org/secure/attachment/19011/19011_original.json&quot; title=&quot;original.json attached to NETCONF-1054&quot;&gt;original.json&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://jira.opendaylight.org/images/icons/link_attachment_7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt; and &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://jira.opendaylight.org/secure/attachment/19012/19012_expected-list-POST.json&quot; title=&quot;expected-list-POST.json attached to NETCONF-1054&quot;&gt;expected-list-POST.json&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://jira.opendaylight.org/images/icons/link_attachment_7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;IMO we have everything needed in &lt;tt&gt;BaseYangOpenApiGenerator#addPaths&lt;/tt&gt; to easily implement all needed logic to distinguish between container and list and add child local name into schema name.&lt;/p&gt;

&lt;p&gt;This approach solves the problem with XML payloads, too.&lt;/p&gt;</comment>
                            <comment id="72432" author="ivanhrasko" created="Wed, 2 Aug 2023 14:47:13 +0000"  >&lt;p&gt;The XML problem mentioned here is solved by &lt;a href=&quot;https://jira.opendaylight.org/browse/NETCONF-1101&quot; title=&quot;OpenApi: Remove incorrect list POST requests&quot; class=&quot;issue-link&quot; data-issue-key=&quot;NETCONF-1101&quot;&gt;&lt;del&gt;NETCONF-1101&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="72503" author="ivanhrasko" created="Thu, 24 Aug 2023 07:35:54 +0000"  >&lt;p&gt;There are some problems on 5.0.x and 4.0.x branches. &lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=yaroslav.lastivka&quot; class=&quot;user-hover&quot; rel=&quot;yaroslav.lastivka&quot;&gt;yaroslav.lastivka&lt;/a&gt; please explain/fix.&lt;/p&gt;</comment>
                            <comment id="72528" author="JIRAUSER15510" created="Fri, 8 Sep 2023 08:10:04 +0000"  >&lt;p&gt;Since we have applied changes &lt;a href=&quot;https://git.opendaylight.org/gerrit/c/netconf/+/107479&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/c/netconf/+/107479&lt;/a&gt; on 5.0.x and 4.0.x, we faced the problem of unnecessary &quot;_post&quot;, and &quot;_xml&quot; prefixes for POST requests.&lt;br/&gt;
Cherry-picking &lt;a href=&quot;https://git.opendaylight.org/gerrit/c/netconf/+/107567#/q/cc6f8b0d874209c1888b3da2d4e5f448a068d3cc&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/c/netconf/+/107567#/q/cc6f8b0d874209c1888b3da2d4e5f448a068d3cc&lt;/a&gt; on 4.0.x and 5.0.x branches resolved this issue.&lt;/p&gt;</comment>
                            <comment id="72530" author="ivanhrasko" created="Fri, 8 Sep 2023 10:26:05 +0000"  >&lt;p&gt;OK, thanks.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                            <outwardlinks description="blocks">
                                        <issuelink>
            <issuekey id="37041">NETCONF-1077</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="37009">NETCONF-1057</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is blocked by">
                                        <issuelink>
            <issuekey id="37145">NETCONF-1101</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="37032">NETCONF-1071</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                                                <inwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="37200">NETCONF-1137</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="36515">NETCONF-938</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="19010" name="expected-container-POST.json" size="40675" author="ivanhrasko" created="Wed, 2 Aug 2023 12:34:35 +0000"/>
                            <attachment id="19013" name="expected-container-in-container-POST.json" size="64558" author="ivanhrasko" created="Wed, 2 Aug 2023 14:33:29 +0000"/>
                            <attachment id="19012" name="expected-list-POST.json" size="27851" author="ivanhrasko" created="Wed, 2 Aug 2023 12:35:18 +0000"/>
                            <attachment id="19014" name="expected-list-in-list-POST.json" size="64653" author="ivanhrasko" created="Wed, 2 Aug 2023 14:33:29 +0000"/>
                            <attachment id="18902" name="netconf-1045.postman_collection-1.json" size="5826" author="ivanhrasko" created="Tue, 13 Jun 2023 12:38:40 +0000"/>
                            <attachment id="19011" name="original.json" size="27637" author="ivanhrasko" created="Wed, 2 Aug 2023 12:35:00 +0000"/>
                            <attachment id="19009" name="original2.json" size="43568" author="ivanhrasko" created="Wed, 2 Aug 2023 12:34:21 +0000"/>
                            <attachment id="19015" name="original3.json" size="64439" author="ivanhrasko" created="Wed, 2 Aug 2023 14:33:29 +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|i045g7:</customfieldvalue>

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