<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:15:24 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-587] Restconf Apidoc can&apos;t list mounted resources</title>
                <link>https://jira.opendaylight.org/browse/NETCONF-587</link>
                <project id="10142" key="NETCONF">netconf</project>
                    <description>&lt;p&gt;Problem: when swagger access apidoc/apis/mounts via &lt;a href=&quot;http://127.0.0.1:8181/apidoc/explorer/index.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://127.0.0.1:8181/apidoc/explorer/index.html&lt;/a&gt;&#65292;&lt;br/&gt;
the explorer can&apos;t show mounted resources, only some undefined.&lt;br/&gt;
Walk the source code in sal-rest-docgen, find that the method &quot;getListOfMounts&quot; of &lt;br/&gt;
org.opendaylight.netconf.sal.rest.doc.impl.ApiDocServiceImpl generate a response json string entity.&lt;/p&gt;
{&quot;instance&quot;:&quot;/network-topology:network-topology/topology/topology-netconf/node/test/&quot;,&quot;id&quot;:1}
&lt;p&gt;]&lt;br/&gt;
but it will be converted by org.opendaylight.aaa.provider.GsonProvider(located aaa-shiro)&lt;br/&gt;
specified in ApiDocApplication. GsonProvider internally use com.google.gson.Gson to do this&#65306;&lt;/p&gt;

&lt;p&gt;public void writeTo(T type, Class&amp;lt;?&amp;gt; theClass, Type genericType, Annotation[] annotations,&lt;br/&gt;
 MediaType mediaType, MultivaluedMap&amp;lt;String, Object&amp;gt; httpHeaders,&lt;br/&gt;
 OutputStream entityStream) throws WebApplicationException {&lt;/p&gt;

&lt;p&gt;try (PrintWriter printWriter = new PrintWriter(entityStream)) {&lt;br/&gt;
 String json;&lt;br/&gt;
 final MultivaluedMap&amp;lt;String, String&amp;gt; queryParameters = ui != null ? ui.getQueryParameters() : null;&lt;br/&gt;
 if (queryParameters != null &amp;amp;&amp;amp; queryParameters.containsKey(PRETTY_PRINT)) &lt;/p&gt;
{
 json = prettyGson.toJson(type);
 }
&lt;p&gt; else &lt;/p&gt;
{
 json = gson.toJson(type);
 }
&lt;p&gt; printWriter.write(json);&lt;br/&gt;
 printWriter.flush();&lt;br/&gt;
 }&lt;br/&gt;
 }&lt;br/&gt;
}&lt;/p&gt;


&lt;p&gt;The problem is here, when the type parameter itself is a json string , it is no need to converted.&lt;br/&gt;
otherwise, the special character in type will escape.&lt;br/&gt;
For examle, GET /apidoc/apis/mounts will expect to return:&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;\{&amp;quot;instance&amp;quot;:&amp;quot;/network-topology:network-topology/topology/topology-netconf/node/test/&amp;quot;,&amp;quot;id&amp;quot;:1}&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;But now the string above will be converted by GsonProvider to:&lt;br/&gt;
&quot;&lt;span class=&quot;error&quot;&gt;&amp;#91;\{\&amp;quot;instance\&amp;quot;:\&amp;quot;/network-topology:network-topology/topology/topology-netconf/node/test/\&amp;quot;,\&amp;quot;id\&amp;quot;:1}&amp;#93;&lt;/span&gt;&quot;&lt;/p&gt;

&lt;p&gt;when the explorer/lib/odl/list_mounts.js, as follow:&lt;br/&gt;
var loadMountList = function( dom ) {&lt;br/&gt;
 dom.empty();&lt;br/&gt;
 dom.append( &quot;&amp;lt;p&amp;gt;Loading. Please wait...&amp;lt;/p&amp;gt;&quot; );&lt;br/&gt;
 $.ajax( {&lt;br/&gt;
 url: &quot;/apidoc/apis/mounts&quot;,&lt;br/&gt;
 datatype: &apos;jsonp&apos;,&lt;br/&gt;
 success: function( strData ){&lt;br/&gt;
 var myData = strData;&lt;br/&gt;
 var list = $( &quot;&amp;lt;table&amp;gt;&amp;lt;/table&amp;gt;&quot; );&lt;br/&gt;
 for( var key in myData )&lt;/p&gt;
 {
 list.append( &quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;a href=\&quot;#\&quot; onclick=\&quot;loadMount(&quot; + 
 myData[key].id + &quot;, &apos;&quot; + myData[key].instance + &quot;&apos;)\&quot;&amp;gt;&quot; +
 myData[key].instance + &quot;&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&quot;);
 }
&lt;p&gt; dom.empty();&lt;br/&gt;
 dom.append( list );&lt;br/&gt;
 }&lt;br/&gt;
 } );&lt;br/&gt;
}&lt;br/&gt;
will treat it as string other than a json object, so the page can&apos;t show the apis of mounted points.&lt;/p&gt;</description>
                <environment></environment>
        <key id="31189">NETCONF-587</key>
            <summary>Restconf Apidoc can&apos;t list mounted resources</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.opendaylight.org/images/icons/priorities/critical.svg">High</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="wusandi">sandi wu</assignee>
                                    <reporter username="wusandi">sandi wu</reporter>
                        <labels>
                            <label>restconf</label>
                    </labels>
                <created>Wed, 12 Dec 2018 15:32:14 +0000</created>
                <updated>Tue, 19 Mar 2019 13:43:41 +0000</updated>
                            <resolved>Tue, 19 Mar 2019 13:43:41 +0000</resolved>
                                    <version>Oxygen</version>
                    <version>Oxygen SR3</version>
                                    <fixVersion>Neon</fixVersion>
                                    <component>restconf-nb</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                    <workratio workratioPercent="0"/>
                                    <progress percentage="0">
                                    <originalProgress>
                                                    <row percentage="100" backgroundColor="#89afd7"/>
                                            </originalProgress>
                                                    <currentProgress>
                                                    <row percentage="0" backgroundColor="#51a825"/>
                                                    <row percentage="100" backgroundColor="#ec8e00"/>
                                            </currentProgress>
                            </progress>
                                    <aggregateprogress percentage="0">
                                    <originalProgress>
                                                    <row percentage="100" backgroundColor="#89afd7"/>
                                            </originalProgress>
                                                    <currentProgress>
                                                    <row percentage="0" backgroundColor="#51a825"/>
                                                    <row percentage="100" backgroundColor="#ec8e00"/>
                                            </currentProgress>
                            </aggregateprogress>
                                    <timeoriginalestimate seconds="3600">1 hour</timeoriginalestimate>
                            <timeestimate seconds="3600">1 hour</timeestimate>
                                            <issuelinks>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                                                <inwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="30177">NETCONF-548</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </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_10202" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Priority</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10312"><![CDATA[High]]></customfieldvalue>

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

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