<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 19:52:43 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-311] Strings with certain special characters in JSON cause RESTCONF to return 400 Bad Request</title>
                <link>https://jira.opendaylight.org/browse/CONTROLLER-311</link>
                <project id="10113" key="CONTROLLER">controller</project>
                    <description>&lt;p&gt;I have a config datastore model in yang, which contains a string field.&lt;/p&gt;

&lt;p&gt;When I try to push a new entry via Restconf using JSON, if this string has a colon in it, it gets rewritten. For example, if my original string is &quot;openflow:21&quot;, what appears in the datastore is &quot;&lt;span class=&quot;error&quot;&gt;&amp;#91;openflow - 21&amp;#93;&lt;/span&gt;&quot;.&lt;/p&gt;

&lt;p&gt;When using XML, this does not happen; the original string appears in the datastore.&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="24865">CONTROLLER-311</key>
            <summary>Strings with certain special characters in JSON cause RESTCONF to return 400 Bad Request</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="10000">Done</resolution>
                                        <assignee username="jgloncak">Jozef Gloncak</assignee>
                                    <reporter username="zoltan.lajos.kis@ericsson.com">Zoltan Lajos Kis</reporter>
                        <labels>
                    </labels>
                <created>Mon, 14 Apr 2014 05:16:02 +0000</created>
                <updated>Tue, 25 Jul 2023 08:23:28 +0000</updated>
                            <resolved>Thu, 16 Oct 2014 11:20:52 +0000</resolved>
                                                                    <component>restconf</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="47968" author="jgloncak" created="Wed, 23 Apr 2014 09:44:08 +0000"  >&lt;p&gt;Which is YANG type for &quot;openflow:21&quot;? (leafref?)&lt;br/&gt;
What is the module name of YANG file where this leaf is present?&lt;br/&gt;
Is this beheviour seen for every leaf YANG type?&lt;/p&gt;</comment>
                            <comment id="47969" author="zoltan.lajos.kis@ericsson.com" created="Wed, 23 Apr 2014 10:03:27 +0000"  >&lt;p&gt;That is just a simple string type leaf in any container. Define the following simple config model for your bundle:&lt;/p&gt;

&lt;p&gt;grouping mydata {&lt;br/&gt;
  leaf id &lt;/p&gt;
{ type uint64; }
&lt;p&gt;  leaf data &lt;/p&gt;
{ type string; }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;container mycontainer {&lt;br/&gt;
  list data &lt;/p&gt;
{
    uses mydata;
    key &quot;id&quot;;
  }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Then try to add an element to this container via restconf, using JSON encoding, where the data string is &quot;openflow:21&quot;.&lt;/p&gt;

&lt;p&gt;What I see in this case is that the POST is successful, but when I try to read back the data (either via restconf, or via the databrokerservice), the string contents turn into &quot;&lt;span class=&quot;error&quot;&gt;&amp;#91;openflow - 21&amp;#93;&lt;/span&gt;&quot;.&lt;/p&gt;</comment>
                            <comment id="47970" author="jgloncak" created="Thu, 24 Apr 2014 06:22:47 +0000"  >&lt;p&gt;If input string contained colon (&lt;img class=&quot;emoticon&quot; src=&quot;https://jira.opendaylight.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; then it was dealed as namespace:value&lt;br/&gt;
and object of type IdentityValuesDTO was created (it is probable that&lt;br/&gt;
data could be of type identityref). If data wasn&apos;t of type leafref then it&lt;br/&gt;
was incorrectly processed as leafref.&lt;br/&gt;
The RestCodec was updated to correctly translate data (cases when data&lt;br/&gt;
contains &apos;:&apos; but aren&apos;t of type leafref)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/6335/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/6335/&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="47971" author="jgloncak" created="Wed, 30 Apr 2014 06:23:54 +0000"  >&lt;p&gt;Merged on 28APR2014&lt;/p&gt;</comment>
                            <comment id="47972" author="colin@colindixon.com" created="Thu, 25 Sep 2014 03:01:59 +0000"  >&lt;p&gt;So, it turns out it&apos;s not just a colon. I can reproduce this in the latest Helium build as long as the string contains an open angle bracket (&amp;lt;) and a colon (&lt;img class=&quot;emoticon&quot; src=&quot;https://jira.opendaylight.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; with the angle bracket coming before the colon.&lt;/p&gt;

&lt;p&gt;I found this originally by testing this snippet (which I got from the ONF spec for TTPs) against the TTP project at the URL:&lt;br/&gt;
&lt;a href=&quot;http://localhost:8181/restconf/config/onf-ttp:opendaylight-ttps/onf-ttp:table-type-patterns/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://localhost:8181/restconf/config/onf-ttp:opendaylight-ttps/onf-ttp:table-type-patterns/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
    &quot;table-type-patterns&quot;: {&lt;br/&gt;
        &quot;table-type-pattern&quot;: [&lt;br/&gt;
            {&lt;br/&gt;
                &quot;identifiers&quot;: [&lt;br/&gt;
                    &lt;/p&gt;
{
                        &quot;doc&quot;: [
                            &quot;The VLAN ID of a locally attached L2 subnet on a Router.&quot;
                        ],
                        &quot;var&quot;: &quot;&amp;lt;subnet_VID&amp;gt;&quot;
                    }
&lt;p&gt;,&lt;/p&gt;
                    {
                        &quot;doc&quot;: [
                            &quot;An OpenFlow group identifier (integer) identifying a group table entry&quot;,
                            &quot;of the type indicated by the variable name&quot;
                        ],
                      &quot;var&quot;: &quot;&amp;lt;&amp;lt;group_entry_types:name&amp;gt;&amp;gt;&quot;
                    }
&lt;p&gt;                ]&lt;br/&gt;
            }&lt;br/&gt;
        ]&lt;br/&gt;
    }&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;The key line is:&lt;br/&gt;
&quot;var&quot;: &quot;&amp;lt;&amp;lt;group_entry_types:name&amp;gt;&amp;gt;&quot;&lt;/p&gt;

&lt;p&gt;Things that fail:&lt;br/&gt;
&quot;var&quot;: &quot;&amp;lt;&amp;lt;group_entry_types:name&amp;gt;&amp;gt;&quot;&lt;br/&gt;
&quot;var&quot;: &quot;&amp;lt;group_entry_types:name&amp;gt;&amp;gt;&quot;&lt;br/&gt;
&quot;var&quot;: &quot;&amp;lt;groupentrytypes:name&amp;gt;&amp;gt;&quot;&lt;br/&gt;
&quot;var&quot;: &quot;&amp;lt;groupentrytypes:name&quot;&lt;br/&gt;
&quot;var&quot;: &quot;groupentryt&amp;lt;ypes:name&quot;&lt;/p&gt;

&lt;p&gt;Things that succeed:&lt;br/&gt;
&quot;var&quot;: &quot;groupentrytypes:name&amp;gt;&amp;gt;&quot;&lt;br/&gt;
&quot;var&quot;: &quot;&amp;lt;&amp;lt;groupentrytypes/name&amp;gt;&amp;gt;&quot;&lt;br/&gt;
&quot;var&quot;: &quot;groupentrytypes:na&amp;lt;me&quot;&lt;/p&gt;


&lt;p&gt;I&apos;m just running the most recent Helium karaf distro and then running this in install the relevant features:&lt;br/&gt;
feature:install standard odl-restconf odl-mdsal-broker odl-mdsal-apidocs odl-ttp-all&lt;/p&gt;</comment>
                            <comment id="47973" author="colin@colindixon.com" created="Thu, 25 Sep 2014 03:03:16 +0000"  >&lt;p&gt;The error I get back is:&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
    &quot;errors&quot;: {&lt;br/&gt;
        &quot;error&quot;: [&lt;/p&gt;
            {
                &quot;error-type&quot;: &quot;protocol&quot;,
                &quot;error-tag&quot;: &quot;malformed-message&quot;,
                &quot;error-message&quot;: &quot;Error parsing input: Illegal character in path at index 0: &amp;lt;&amp;lt;groupentrytypes&quot;
            }
&lt;p&gt;        ]&lt;br/&gt;
    }&lt;br/&gt;
}&lt;/p&gt;</comment>
                            <comment id="47974" author="jgloncak" created="Thu, 25 Sep 2014 08:28:31 +0000"  >&lt;p&gt;should be fixed&lt;br/&gt;
&lt;a href=&quot;https://git.opendaylight.org/gerrit/11566&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/11566&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="47975" author="jgloncak" created="Tue, 14 Oct 2014 10:55:52 +0000"  >&lt;p&gt;The direct e-mail was sent to Giovanni Meo. It was asked for fix merging.&lt;/p&gt;</comment>
                            <comment id="47976" author="jgloncak" created="Thu, 16 Oct 2014 11:20:52 +0000"  >&lt;p&gt;merged on 15. october 2014&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>720</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=720]]></customfieldvalue>

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

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