<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:52:20 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>[YANGTOOLS-127] yang-data-api: ClassCastException when serializing enums</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-127</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;I am testing minimal toaster distro found here:&lt;br/&gt;
&lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/5825/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/5825/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Steps to reproduce:&lt;br/&gt;
run odl with toaster&lt;br/&gt;
do&lt;br/&gt;
curl &lt;a href=&quot;http://localhost:8080/restconf/operational/toaster:toaster/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://localhost:8080/restconf/operational/toaster:toaster/&lt;/a&gt; -v&lt;br/&gt;
An exception appears in logs: (some JSON is returned to the http client)&lt;/p&gt;

&lt;p&gt;2014-04-02 08:56:44.325 CEST &lt;span class=&quot;error&quot;&gt;&amp;#91;qtp1112930044-117&amp;#93;&lt;/span&gt; ERROR o.o.c.sal.restconf.impl.RestCodec - ClassCastException was thrown when codec is invoked with parameter Up&lt;br/&gt;
java.lang.ClassCastException: org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.Toaster$ToasterStatus cannot be cast to java.lang.String&lt;br/&gt;
	at org.opendaylight.yangtools.yang.data.impl.codec.TypeDefinitionAwareCodec$EnumCodecStringImpl.serialize(TypeDefinitionAwareCodec.java:509) ~&lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:na&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.opendaylight.controller.sal.restconf.impl.RestCodec$ObjectCodec.serialize(RestCodec.java:135) ~&lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:na&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.opendaylight.controller.sal.rest.impl.JsonMapper.writeValueOfNodeByType(JsonMapper.java:240) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:na&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.opendaylight.controller.sal.rest.impl.JsonMapper.writeLeaf(JsonMapper.java:193) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:na&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.opendaylight.controller.sal.rest.impl.JsonMapper.writeChildrenOfParent(JsonMapper.java:118) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:na&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.opendaylight.controller.sal.rest.impl.JsonMapper.writeContainer(JsonMapper.java:154) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:na&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.opendaylight.controller.sal.rest.impl.JsonMapper.write(JsonMapper.java:70) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:na&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.opendaylight.controller.sal.rest.impl.StructuredDataToJsonProvider.writeTo(StructuredDataToJsonProvider.java:61) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:na&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.opendaylight.controller.sal.rest.impl.StructuredDataToJsonProvider.writeTo(StructuredDataToJsonProvider.java:33) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:na&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:306) &lt;span class=&quot;error&quot;&gt;&amp;#91;jersey-server-1.17.jar:1.17&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1479) &lt;span class=&quot;error&quot;&gt;&amp;#91;jersey-server-1.17.jar:1.17&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391) &lt;span class=&quot;error&quot;&gt;&amp;#91;jersey-server-1.17.jar:1.17&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381) &lt;span class=&quot;error&quot;&gt;&amp;#91;jersey-server-1.17.jar:1.17&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:na&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:na&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:na&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:3.1.0&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:711) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:9.1.3.v20140225&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:552) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:9.1.3.v20140225&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:9.1.3.v20140225&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:568) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:9.1.3.v20140225&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:9.1.3.v20140225&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1112) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:9.1.3.v20140225&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:479) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:9.1.3.v20140225&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:9.1.3.v20140225&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1046) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:9.1.3.v20140225&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:9.1.3.v20140225&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:199) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:9.1.3.v20140225&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:9.1.3.v20140225&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:9.1.3.v20140225&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.eclipse.jetty.server.Server.handle(Server.java:462) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:9.1.3.v20140225&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:281) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:9.1.3.v20140225&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:232) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:9.1.3.v20140225&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.eclipse.jetty.io.AbstractConnection$1.run(AbstractConnection.java:505) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:9.1.3.v20140225&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:9.1.3.v20140225&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:9.1.3.v20140225&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at java.lang.Thread.run(Thread.java:744) &lt;span class=&quot;error&quot;&gt;&amp;#91;na:1.7.0_51&amp;#93;&lt;/span&gt;&lt;/p&gt;


&lt;hr /&gt;

&lt;p&gt;This is probably related to the fact that org.opendaylight.yangtools.yang.data.api.codec.EnumCodec#serialize has String parameter and ToasterStatus is an enum? Deserialization also looks suspicious IMO&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="22547">YANGTOOLS-127</key>
            <summary>yang-data-api: ClassCastException when serializing enums</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="lborak@cisco.com">Ladislav Borak</assignee>
                                    <reporter username="tolvecky@cisco.com">Tomas Olvecky</reporter>
                        <labels>
                    </labels>
                <created>Wed, 2 Apr 2014 07:22:32 +0000</created>
                <updated>Sun, 10 Apr 2022 18:35:02 +0000</updated>
                            <resolved>Tue, 8 Apr 2014 11:24:23 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="42697" author="lborak@cisco.com" created="Mon, 7 Apr 2014 07:37:23 +0000"  >&lt;p&gt;I tried to reproduce this bug using:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/5825/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/5825/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and &lt;/p&gt;

&lt;p&gt;curl &lt;a href=&quot;http://localhost:8080/restconf/operational/toaster:toaster/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://localhost:8080/restconf/operational/toaster:toaster/&lt;/a&gt; -v&lt;/p&gt;

&lt;p&gt;and response was:&lt;/p&gt;

&lt;p&gt;GET /restconf/operational/toaster:toaster/ HTTP/1.1&lt;br/&gt;
User-Agent: curl/7.18.0 (i586-pc-mingw32msvc) libcurl/7.18.0 zlib/1.2.3&lt;br/&gt;
Host: 192.168.9.1:8080&lt;br/&gt;
Accept: &lt;b&gt;/&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;HTTP/1.1 200 OK&lt;br/&gt;
Server: Apache-Coyote/1.1&lt;br/&gt;
Cache-Control: private&lt;br/&gt;
Expires: Thu, 01 Jan 1970 01:00:00 CET&lt;br/&gt;
Content-Type: application/yang.data+json&lt;br/&gt;
Transfer-Encoding: chunked&lt;br/&gt;
Date: Mon, 07 Apr 2014 07:25:40 GMT&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
    &quot;toaster&quot;: &lt;/p&gt;
{
        &quot;toasterManufacturer&quot;: &quot;Opendaylight&quot;,
        &quot;toasterModelNumber&quot;: &quot;Model 1 - Binding Aware&quot;,
        &quot;toasterStatus&quot;: &quot;Up&quot;
    }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;It seems to be, it works correctly.&lt;/p&gt;</comment>
                            <comment id="42698" author="lborak@cisco.com" created="Mon, 7 Apr 2014 10:53:32 +0000"  >&lt;p&gt;Propsed patch:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/5938/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/5938/&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10002">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="22521">YANGTOOLS-101</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>646</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=646]]></customfieldvalue>

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

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