<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 19:53: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>[CONTROLLER-654] singleton lists are not rendered as lists by StructuredDataToJsonProvider</title>
                <link>https://jira.opendaylight.org/browse/CONTROLLER-654</link>
                <project id="10113" key="CONTROLLER">controller</project>
                    <description>&lt;p&gt;If I have a model with a list of string, like the leaf-list on line 32 here:&lt;br/&gt;
&lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/8975/4/ttp-model/model/src/main/yang/ttp.yang&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/8975/4/ttp-model/model/src/main/yang/ttp.yang&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And I use the builder to add a singleton list of strings like this:&lt;br/&gt;
        NDMMetadata NDMmeta = new NDMMetadataBuilder()&lt;br/&gt;
                .setDoc(Arrays&lt;br/&gt;
                        .asList(&quot;TTP supporting L2 VLANs (unicast, multicast, flooding) with optional VID translation.&quot;))&lt;br/&gt;
                .setAuthority(&quot;org.opennetworking.fawg&quot;).build();&lt;/p&gt;

&lt;p&gt;When I covert it to JSON, I get a single string, not a list containing a single stiring. That is I get this:&lt;br/&gt;
{&lt;br/&gt;
    &quot;NDM_metadata&quot;: &lt;/p&gt;
{
        &quot;authority&quot;: &quot;org.opennetworking.fawg&quot;,
        &quot;doc&quot;: &quot;TTP supporting L2 VLANs (unicast, multicast, flooding) with optional VID translation.&quot;
    }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;but, I&apos;d expect this:&lt;br/&gt;
{&lt;br/&gt;
    &quot;NDM_metadata&quot;: &lt;/p&gt;
{
        &quot;authority&quot;: &quot;org.opennetworking.fawg&quot;,
        &quot;doc&quot;: [&quot;TTP supporting L2 VLANs (unicast, multicast, flooding) with optional VID translation.&quot;]
    }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Is this a bug or expected behavior?&lt;/p&gt;

&lt;p&gt;If you want to check it out, this patch set has an example:&lt;br/&gt;
&lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/8975/4/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/8975/4/&lt;/a&gt;&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: Mac OS&lt;br/&gt;
Platform: PC&lt;/p&gt;</environment>
        <key id="25208">CONTROLLER-654</key>
            <summary>singleton lists are not rendered as lists by StructuredDataToJsonProvider</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="10003">Cannot Reproduce</resolution>
                                        <assignee username="jgloncak">Jozef Gloncak</assignee>
                                    <reporter username="colindixon">Colin Dixon</reporter>
                        <labels>
                    </labels>
                <created>Tue, 29 Jul 2014 17:10:49 +0000</created>
                <updated>Tue, 25 Jul 2023 08:24:03 +0000</updated>
                            <resolved>Fri, 1 Aug 2014 03:03:42 +0000</resolved>
                                                                    <component>restconf</component>
                        <due>Fri, 1 Aug 2014 00:00:00 +0000</due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="48782" author="jgloncak" created="Wed, 30 Jul 2014 09:39:17 +0000"  >&lt;p&gt;can you please specify how you convert NDMmeta object to JSON?&lt;/p&gt;</comment>
                            <comment id="48783" author="jgloncak" created="Wed, 30 Jul 2014 10:40:56 +0000"  >&lt;p&gt;Please, ignore my question. I have found it.&lt;/p&gt;</comment>
                            <comment id="48784" author="jgloncak" created="Wed, 30 Jul 2014 12:41:12 +0000"  >&lt;p&gt;Incorrect output is caused by incorrect using of &lt;br/&gt;
StructuredDataToJsonProvider.INSTANCE.writeTo() method.&lt;/p&gt;

&lt;p&gt;First parameter of writeTo method is of type StructuredData. It was created with parameters&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;CompositeNode data - compNode (NDM_metadata container) (OK)&lt;/li&gt;
	&lt;li&gt;DataSchemaNode schema - context (represents whole DataSchema and not only schema for NDM_metadata) (WRONG)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;You have to specify schema for concrete node. You can find concrete schema node in schema context:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;by tracing down schema context programatically (marked as first solution in gerrit)&lt;/li&gt;
	&lt;li&gt;via ControllerContext.toInstanceIdentifier() method (marked as second solution)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/9487/1/ttp-model/model/src/test/java/org/opendaylight/ttp/model/test/TTPYangModelTest.java&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/9487/1/ttp-model/model/src/test/java/org/opendaylight/ttp/model/test/TTPYangModelTest.java&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The behavior when an entry of leaf-list was outputted like leaf and not like list of leaves was default behavior for case when schema for node isn&apos;t presented.&lt;/p&gt;</comment>
                            <comment id="48785" author="colin@colindixon.com" created="Fri, 1 Aug 2014 03:03:42 +0000"  >&lt;p&gt;Thanks for the help. For those who care, I modified Jozef&apos;s code to make it generic and you can find it here:&lt;br/&gt;
&lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/9518/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/9518/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I think most of the functionality or at least the getSchemaNodeForDataObject should be moved into the SchemaContext implementation where we can maintain a map from Class (and/or QName) to DataSchemaNode.&lt;/p&gt;</comment>
                    </comments>
                    <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>1449</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=1449]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10204" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>ODL SR Target Milestone</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10365"><![CDATA[Helium-M5]]></customfieldvalue>

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

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