<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:16:49 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-1158] RestconfSchemaService returns 500 for device model</title>
                <link>https://jira.opendaylight.org/browse/NETCONF-1158</link>
                <project id="10142" key="NETCONF">netconf</project>
                    <description>&lt;p&gt;When sending a GET request to the test-tool device with, for example, the &apos;toaster2&apos; model, it responds with a 500 error when asked for the &apos;Accept: application/yang&apos; header.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://192.168.56.100:8181/rests/modules/network-topology:network-topology/topology=topology-netconf/node=36001-sim-device/yang-ext:mount/toaster2/2009-11-20&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://192.168.56.100:8181/rests/modules/network-topology:network-topology/topology=topology-netconf/node=36001-sim-device/yang-ext:mount/toaster2/2009-11-20&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The same request but with &quot;Accept: application/yin+xml&quot; header is working.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Sending application/yang headers is working for controller models.&lt;/li&gt;
	&lt;li&gt;In Karaf logs, there are no errors.&lt;/li&gt;
	&lt;li&gt;Creating SchemaExportContext is successful for the device model. The exception is thrown in YangSchemaExportBodyWriter with the message:&#160; &quot;Unable to retrieve source from SourceProvider.&quot;&lt;/li&gt;
&lt;/ul&gt;


&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;0 = {StackTraceElement@25842} &quot;org.opendaylight.restconf.nb.rfc8040.jersey.providers.YangSchemaExportBodyWriter.writeTo(YangSchemaExportBodyWriter.java:42)&quot;
1 = {StackTraceElement@25843} &quot;org.opendaylight.restconf.nb.rfc8040.jersey.providers.YangSchemaExportBodyWriter.writeTo(YangSchemaExportBodyWriter.java:28)&quot;
2 = {StackTraceElement@25844} &quot;org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.invokeWriteTo(WriterInterceptorExecutor.java:242)&quot;
3 = {StackTraceElement@25845} &quot;org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo(WriterInterceptorExecutor.java:227)&quot;
4 = {StackTraceElement@25846} &quot;org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:139)&quot;
5 = {StackTraceElement@25847} &quot;org.glassfish.jersey.server.internal.JsonWithPaddingInterceptor.aroundWriteTo(JsonWithPaddingInterceptor.java:85)&quot;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The issue arises from the invocation of &lt;tt&gt;context.sourceProvider()&lt;/tt&gt; within the &lt;tt&gt;YangSchemaExportBodyWriter&lt;/tt&gt; class. This &lt;tt&gt;DOMYangTextSourceProvider&lt;/tt&gt; contains controller models. Probably it will be required to explore alternative methods for generating the &lt;tt&gt;YangTextSchemaSource&lt;/tt&gt;. For example, as it is done in&#160;&lt;br/&gt;
YinSchemaExportBodyWriter.&lt;/p&gt;</description>
                <environment></environment>
        <key id="37401">NETCONF-1158</key>
            <summary>RestconfSchemaService returns 500 for device model</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.opendaylight.org/images/icons/priorities/major.svg">Medium</priority>
                        <status id="1" iconUrl="https://jira.opendaylight.org/images/icons/statuses/open.png" description="The issue is open and ready for the assignee to start work on it.">Open</status>
                    <statusCategory id="2" key="new" colorName="blue-gray"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="ivanhrasko">Ivan Hrasko</assignee>
                                    <reporter username="PeterSuna">Peter Suna</reporter>
                        <labels>
                            <label>pick-next</label>
                            <label>pt</label>
                    </labels>
                <created>Tue, 19 Sep 2023 12:31:59 +0000</created>
                <updated>Thu, 12 Oct 2023 13:20:13 +0000</updated>
                                            <version>7.0.0</version>
                                                    <component>restconf-nb</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="72645" author="petersuna" created="Wed, 11 Oct 2023 17:14:57 +0000"  >&lt;p&gt;The issue here is that we are using `DOMYangTextSourceProvider` from the controller instead of from the device in &lt;a href=&quot;https://github.com/opendaylight/netconf/blob/master/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/utils/parser/ParserIdentifier.java#L218&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;ParseIdentifier#toSchemaExportContextFromIdentifier()&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To obtain the `DOMYangTextSourceProvider` for the device, we need to retrieve it from the device service, which is currently empty due to missing SchemaSourceProvider in the DOMSchemaService.&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; Optional&amp;lt;DOMSchemaService&amp;gt; service = point.getMountPoint().getService(DOMSchemaService.class);
service.get().getExtensions().getInstance(DOMYangTextSourceProvider.class); &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;When the &lt;a href=&quot;https://github.com/opendaylight/netconf/blob/fb67854c7137cefa6224d0e088d9b401de1eef22/plugins/netconf-client-mdsal/src/main/java/org/opendaylight/netconf/client/mdsal/spi/NetconfDeviceMount.java#L67&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;DOMMountPoint is prepared&lt;/a&gt;, DOMSchemaService is created without&#160;SchemaSourceProvider.&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
mountBuilder.addService(DOMSchemaService.class, FixedDOMSchemaService.of(() -&amp;gt; initialCtx)); &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Device SchemaSourceProvider can be obtained from DeviceSources created &lt;a href=&quot;https://github.com/opendaylight/netconf/blob/fb67854c7137cefa6224d0e088d9b401de1eef22/plugins/netconf-client-mdsal/src/main/java/org/opendaylight/netconf/client/mdsal/NetconfDevice.java#L151&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&#160;&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_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i046jb:</customfieldvalue>

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