<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 19:53: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>[CONTROLLER-785] JSON encoding for empty list inside container.</title>
                <link>https://jira.opendaylight.org/browse/CONTROLLER-785</link>
                <project id="10113" key="CONTROLLER">controller</project>
                    <description>&lt;p&gt;TLDR:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&quot;bars&quot;:
{&quot;bar&quot;:[]}
&lt;p&gt;+ &quot;bars&quot;:{}&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;Long version:&lt;/p&gt;

&lt;p&gt;In older ODL builds, JSON encoding for empty list inside a container did not have list name as kay at all. More recent builds, list name is there as a key, with [] as value. I believe the previous behavior was better, as it resulted in shorter JSON.&lt;/p&gt;

&lt;p&gt;Standards and drafts are not very clear:&lt;br/&gt;
Example yang definition:&lt;br/&gt;
  container bars {&lt;br/&gt;
    list bar {&lt;br/&gt;
      leaf foo &lt;/p&gt;
{
        type string;
      }
&lt;p&gt;    }&lt;br/&gt;
  }&lt;/p&gt;

&lt;p&gt;We want to encode empty list in json.&lt;br/&gt;
According to &lt;a href=&quot;http://tools.ietf.org/html/rfc6020#section-7.8.5&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://tools.ietf.org/html/rfc6020#section-7.8.5&lt;/a&gt; the XML representation would be:&lt;br/&gt;
  &amp;lt;bars&amp;gt;&lt;br/&gt;
  &amp;lt;/bars&amp;gt;&lt;br/&gt;
(note zero occurrences of &amp;lt;bar&amp;gt;)&lt;/p&gt;

&lt;p&gt;This draft for json lists &lt;a href=&quot;http://tools.ietf.org/html/draft-lhotka-netmod-yang-json-02#section-3.2.4&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://tools.ietf.org/html/draft-lhotka-netmod-yang-json-02#section-3.2.4&lt;/a&gt; only tells what to do with one or more elements.&lt;/p&gt;

&lt;p&gt;But for containers &lt;a href=&quot;http://tools.ietf.org/html/draft-lhotka-netmod-yang-json-02#section-3.2.2&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://tools.ietf.org/html/draft-lhotka-netmod-yang-json-02#section-3.2.2&lt;/a&gt; I believe these two mappings are implied:&lt;/p&gt;

&lt;p&gt;  &amp;lt;bars&amp;gt;&lt;br/&gt;
    &amp;lt;bar/&amp;gt;&lt;br/&gt;
  &amp;lt;/bars&amp;gt;&lt;br/&gt;
would perhaps map to {&quot;bars&quot;:{&quot;bar&quot;:[]}}&lt;/p&gt;

&lt;p&gt;but&lt;br/&gt;
  &amp;lt;bars&amp;gt;&lt;br/&gt;
  &amp;lt;/bars&amp;gt;&lt;br/&gt;
would definitely map to {&quot;bars:{}}&lt;/p&gt;

&lt;p&gt;Once again, the previous behavior seem to be the correct one.&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: Linux&lt;br/&gt;
Platform: PC&lt;/p&gt;</environment>
        <key id="25339">CONTROLLER-785</key>
            <summary>JSON encoding for empty list inside container.</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                                <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="10002">Duplicate</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="vrpolak">Vratko Polak</reporter>
                        <labels>
                    </labels>
                <created>Mon, 8 Sep 2014 14:27:54 +0000</created>
                <updated>Thu, 19 Oct 2017 22:13:23 +0000</updated>
                            <resolved>Tue, 9 Sep 2014 08:52:22 +0000</resolved>
                                    <version>Helium</version>
                                                    <component>restconf</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                    <issuelinks>
                            <issuelinktype id="10002">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="22708">YANGTOOLS-288</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </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_10208" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>External issue ID</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1744</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10201" key="com.atlassian.jira.plugin.system.customfieldtypes:url">
                        <customfieldname>External issue URL</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[https://bugs.opendaylight.org/show_bug.cgi?id=1744]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i02mjj:</customfieldvalue>

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