<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:56:11 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-1446] Some BBF Yang models have errors when generating swagger for mounted device</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-1446</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;We are working on a PON project and just upgraded to Lighty 16.0.0 which uses :&lt;br/&gt;
YangTools version 8.0.3, NETCONF 3.0.2, MDSAL 9.0.2&lt;/p&gt;

&lt;p&gt;We have a PON netconf device using bbf-l2-forwarding YANG models as well as bbf-sub-interface-tagging yang models.&lt;/p&gt;

&lt;p&gt;After the device mounts to ODL, the swagger for the mounted device cannot be generated. ODL prints errors such as:&lt;/p&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;2022-07-13T17:37:32.454 [${env:APP_NAME}] [${env:APP_VERSION}] WARN pondc CommScope [] [${env:NODE_NAME}] qtp1770701191-199 [] HttpChannel.handleException - /apidoc/openapi3/18/apis/mounts/6
javax.servlet.ServletException: java.lang.IllegalArgumentException: Schema tree child (urn:bbf:yang:bbf-l2-forwarding?revision=2020-10-13)mac-address-value not present in schema parent (urn:bbf:yang:bbf-l2-forwarding?revision=2020-10-13)mac-address
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:432) ~[jersey-container-servlet-core-2.27.jar:?]
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:370) ~[jersey-container-servlet-core-2.27.jar:?]&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;One problem that seems to be recurring is that the &#8220;choice&#8221; fields in the yang models are named something X, and underneath the choice there could be a leaf/container/case named the same thing. &lt;br/&gt;
I think this is confusing ODL&#8217;s yang tool parser?&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;p&gt;1) bbf-l2-forwarding-forwarding-databases@2020-10-13.yang &lt;br/&gt;
A yang model has a case statement like this.. and then has a choice under it with the same name as the case..&lt;/p&gt;

&lt;p&gt;ODL doesn&#8217;t like this at all. If I change the name of the choice to allow-to-learn-on-choice.. it accepts this syntax.&lt;/p&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;case allowed-to-learn-on {
  if-feature &quot;mac-learning&quot;;
  choice allowed-to-learn-on { // Same as the case statement.. ODL doesn&#8217;t like it. If I change this name to something else, ODL is happy.
    description
      &quot;The source MAC address of the frame can be learned
       on any of the ports or interfaces as identified
       further.&quot;;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;2) bbf-frame-classification@2021-06-02&lt;/p&gt;

&lt;p&gt;Here we have a choice statement called &#8220;mac-address&#8221; and then inside that choice statement we have a leaf defining a mac-address as well. ODL cannot handle this.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&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;grouping mac-address-match {
  description
    &quot;Provides a set of leafs that allow to classify a MAC address.&quot;;
    choice mac-address { // take note of this.. 

    case mac-address-filter {
      description
        &quot;The value and the mask together identify a set of MAC
         addresses that comply with this classification. Evaluation
         is performed by making a bit-wise AND operation between the
         to be evaluated MAC address and the mac-address-mask. There
         is a match if the result equals the value specified in the
         mac-address-value.&quot;;
      leaf mac-address-value {
        type yang:mac-address; // This seems valid to me. But choice is the same name.. I think that is illegal here.?
        description &quot;The value with which a comparison shall be made after performing the bit-wise AND operation on the to be evaluated MAC address.&quot;;
      }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I have attached two tar files which contain minimal yang to recreate the issue. &lt;br/&gt;
1) l2-forwarding-yang.tar.gz - this can be fed into a NETCONF testtool simulator to reproduce the issue with l2-forwarding YANG models&lt;/p&gt;

&lt;p&gt;2) sub-intf-tagging-yang.tar.gz - this contains the minimal amount of bbf-sub-interface-tagging yang to reproduce the issue for that yang. A NETCONF testtool simulator can be fed these to reproduce the issue on that yang.&lt;/p&gt;

&lt;p&gt;I have also attached debug logs for each issue.&lt;/p&gt;

&lt;p&gt;To reproduce create a NETCONF testtool simulator with one of the bunches of YANGs as the schema. Add to ODL, After the device connects/mounts, try to get to the swagger page for the device.&lt;/p&gt;</description>
                <environment></environment>
        <key id="36016">YANGTOOLS-1446</key>
            <summary>Some BBF Yang models have errors when generating swagger for mounted device</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="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="-1">Unassigned</assignee>
                                    <reporter username="rmagaldi">Robert Magaldi</reporter>
                        <labels>
                    </labels>
                <created>Wed, 13 Jul 2022 22:05:35 +0000</created>
                <updated>Mon, 24 Oct 2022 20:08:45 +0000</updated>
                            <resolved>Mon, 24 Oct 2022 20:08:45 +0000</resolved>
                                    <version>8.0.3</version>
                                                        <due></due>
                            <votes>1</votes>
                                    <watches>2</watches>
                                                                                                                    <issuelinks>
                            <issuelinktype id="10002">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="35837">NETCONF-883</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="17904" name="errorDuringSwaggerForL2ForwardingYang.txt" size="25078" author="rmagaldi" created="Wed, 13 Jul 2022 22:05:05 +0000"/>
                            <attachment id="17903" name="errorDuringSwaggerForSubInterfaceYang.txt" size="24188" author="rmagaldi" created="Wed, 13 Jul 2022 22:05:05 +0000"/>
                            <attachment id="17902" name="l2-forwarding-yang.tar.gz" size="46637" author="rmagaldi" created="Wed, 13 Jul 2022 22:05:05 +0000"/>
                            <attachment id="17901" name="sub-intf-tagging-yang.tar.gz" size="16715" author="rmagaldi" created="Wed, 13 Jul 2022 22:05:05 +0000"/>
                    </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|i042pb:</customfieldvalue>

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