<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:16:57 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-1215] Mandatory attributes in RPC input are not honoured</title>
                <link>https://jira.opendaylight.org/browse/NETCONF-1215</link>
                <project id="10142" key="NETCONF">netconf</project>
                    <description>&lt;p&gt;We are using ODL Boron.&lt;/p&gt;

&lt;p&gt;Mandatory attributes inside RPC input are not honoured , therefore RPC&#8217;s can be invoked without passing mandatory attributes.&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;rpc say-hello {
  input {
    leaf name {
      type string;
      mandatory true;
    }
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Whereas with RESTCONF url&#8217;s the mandatory attributes validation is happening&lt;/p&gt;

&lt;p&gt;RESTCONF ERROR:&lt;br/&gt;
 There is no Error to the North Bound(In the APIDOCS page), but in the server side, below logs are printed, CDS is not updated with the values as the validation is failed.&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;Caused by: java.lang.IllegalArgumentException: Node (urn:opendaylight:params:xml:ns:yang:normalizednodedemo?revision=2015-01-05)emp-list[
{(urn:opendaylight:params:xml:ns:yang:normalizednodedemo?revision=2015-01-05)name=vikram}
] is missing mandatory descendant /(urn:opendaylight:params:xml:ns:yang:normalizednodedemo?revision=2015-01-05)age
 at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145)[58:com.google.guava:18.0.0]
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.MandatoryLeafEnforcer$Strict.enforceOnTreeNode(MandatoryLeafEnforcer.java:60)[74:org.opendaylight.yangtools.yang-data-impl:1.0.0.Boron]
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.MandatoryLeafEnforcer$Strict.enforceOnTreeNode(MandatoryLeafEnforcer.java:53)[74:org.opendaylight.yangtools.yang-data-impl:1.0.0.Boron]
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.ListEntryModificationStrategy.applyWrite(ListEntryModificationStrategy.java:41)[74:org.opendaylight.yangtools.yang-data-impl:1.0.0.Boron]
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaAwareApplyOperation.apply(SchemaAwareApplyOperation.java:216)[74:org.opendaylight.yangtools.yang-data-impl:1.0.0.Boron]
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractNodeContainerModificationStrategy.mutateChildren(AbstractNodeContainerModificationStrategy.java:139)[74:org.opendaylight.yangtools.yang-data-impl:1.0.0.Boron]
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractNodeContainerModificationStrategy.applyTouch(AbstractNodeContainerModificationStrategy.java:252)[74:org.opendaylight.yangtools.yang-data-impl:1.0.0.Boron]
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractNodeContainerModificationStrategy.applyMerge(AbstractNodeContainerModificationStrategy.java:170)[74:org.opendaylight.yangtools.yang-data-impl:1.0.0.Boron]
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaAwareApplyOperation.apply(SchemaAwareApplyOperation.java:207)[74:org.opendaylight.yangtools.yang-data-impl:1.0.0.Boron]
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.MinMaxElementsValidation.checkMinMaxElements(MinMaxElementsValidation.java:76)[74:org.opendaylight.yangtools.yang-data-impl:1.0.0.Boron]
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.MinMaxElementsValidation.checkMergeApplicable(MinMaxElementsValidation.java:114)[74:org.opendaylight.yangtools.yang-data-impl:1.0.0.Boron]
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaAwareApplyOperation.checkApplicable(SchemaAwareApplyOperation.java:131)[74:org.opendaylight.yangtools.yang-data-impl:1.0.0.Boron]
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractNodeContainerModificationStrategy.checkChildPreconditions(AbstractNodeContainerModificationStrategy.java:305)[74:org.opendaylight.yangtools.yang-data-impl:1.0.0.Boron]
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractNodeContainerModificationStrategy.checkMergeApplicable(AbstractNodeContainerModificationStrategy.java:313)[74:org.opendaylight.yangtools.yang-data-impl:1.0.0.Boron]
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaAwareApplyOperation.checkApplicable(SchemaAwareApplyOperation.java:131)[74:org.opendaylight.yangtools.yang-data-impl:1.0.0.Boron]
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.StructuralContainerModificationStrategy.checkApplicable(StructuralContainerModificationStrategy.java:99)[74:org.opendaylight.yangtools.yang-data-impl:1.0.0.Boron]
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractNodeContainerModificationStrategy.checkChildPreconditions(AbstractNodeContainerModificationStrategy.java:305)[74:org.opendaylight.yangtools.yang-data-impl:1.0.0.Boron]
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractNodeContainerModificationStrategy.checkTouchApplicable(AbstractNodeContainerModificationStrategy.java:288)[74:org.opendaylight.yangtools.yang-data-impl:1.0.0.Boron]
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaAwareApplyOperation.checkApplicable(SchemaAwareApplyOperation.java:125)[74:org.opendaylight.yangtools.yang-data-impl:1.0.0.Boron]
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.RootModificationApplyOperation.checkApplicable(RootModificationApplyOperation.java:72)[74:org.opendaylight.yangtools.yang-data-impl:1.0.0.Boron]
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractDataTreeTip.validate(AbstractDataTreeTip.java:37)[74:org.opendaylight.yangtools.yang-data-impl:1.0.0.Boron]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;RPC ERROR:&lt;br/&gt;
 Since there is no validation, it is returning the SUCCESSFUL RPC result to the North Bound&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="23187">NETCONF-1215</key>
            <summary>Mandatory attributes in RPC input are not honoured</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="1" iconUrl="https://jira.opendaylight.org/images/icons/priorities/blocker.svg">Highest</priority>
                        <status id="10003" iconUrl="https://jira.opendaylight.org/images/icons/status_generic.gif" description="">Confirmed</status>
                    <statusCategory id="2" key="new" colorName="blue-gray"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="vdarsi@advaoptical.com">Vikram Darsi</reporter>
                        <labels>
                            <label>pick-next</label>
                            <label>pt</label>
                    </labels>
                <created>Mon, 27 Mar 2017 15:58:25 +0000</created>
                <updated>Wed, 3 Jan 2024 17:31:33 +0000</updated>
                                                            <fixVersion>7.0.0</fixVersion>
                                    <component>restconf-nb</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="44394" author="ifoltin" created="Tue, 28 Mar 2017 11:12:39 +0000"  >&lt;p&gt;Hi Vikram,&lt;/p&gt;

&lt;p&gt;well, looking at the stack trace, mandatory node validation in yangtools part works the way it should.&lt;/p&gt;

&lt;p&gt;The mandatory node &quot;age&quot; is not present in the &quot;emp-list&quot; list entry and that is the reason why the exception is thrown.&lt;/p&gt;</comment>
                            <comment id="44395" author="vdarsi@advaoptical.com" created="Tue, 28 Mar 2017 11:35:53 +0000"  >&lt;p&gt;Hi Igor Foltin&lt;/p&gt;

&lt;p&gt;Yes, with RESTCONF the mandatory attributes presence is validated. Bug descriptions says, the same validation is not performed while invoking RPC&apos;s (when its input does not have mandatory attributes)&lt;/p&gt;</comment>
                            <comment id="44396" author="ifoltin" created="Tue, 28 Mar 2017 13:29:53 +0000"  >&lt;p&gt;Could you please provide the exact steps you took to reproduce this behaviour?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                            <comment id="44397" author="vdarsi@advaoptical.com" created="Tue, 28 Mar 2017 14:30:19 +0000"  >&lt;p&gt;Please find the steps followed:&lt;/p&gt;

&lt;p&gt;1. Created sample project using the below command&lt;/p&gt;

&lt;p&gt;mvn archetype:generate -DarchetypeGroupId=org.opendaylight.controller -DarchetypeArtifactId=opendaylight-startup-archetype -DarchetypeRepository=&lt;a href=&quot;http://nexus.opendaylight.org/content/repositories/opendaylight.release/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://nexus.opendaylight.org/content/repositories/opendaylight.release/&lt;/a&gt; -DarchetypeCatalog=&lt;a href=&quot;http://nexus.opendaylight.org/content/repositories/opendaylight.release/archetype-catalog.xml&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://nexus.opendaylight.org/content/repositories/opendaylight.release/archetype-catalog.xml&lt;/a&gt; -DarchetypeVersion=1.2.0-Boron&lt;/p&gt;


&lt;p&gt;2. api/src/main/yang/normalizednodedemo.yang&lt;/p&gt;

&lt;p&gt;module normalizednodedemo {&lt;br/&gt;
    yang-version 1;&lt;br/&gt;
    namespace &quot;urn:opendaylight:params:xml:ns:yang:normalizednodedemo&quot;;&lt;br/&gt;
    prefix &quot;normalizednodedemo&quot;;&lt;/p&gt;

&lt;p&gt;    revision &quot;2015-01-05&quot; &lt;/p&gt;
{
        description &quot;Initial revision of normalizednodedemo model&quot;;
    }

&lt;p&gt;    rpc say-hello {&lt;br/&gt;
       input{&lt;br/&gt;
           leaf name&lt;/p&gt;
{
              type string;
              mandatory true;
           }
&lt;p&gt;       }&lt;br/&gt;
    }&lt;br/&gt;
}&lt;/p&gt;


&lt;p&gt;3. impl/src/main/resources/impl-blueprint.xml&lt;/p&gt;

&lt;p&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;&lt;br/&gt;
&amp;lt;!-- vi: set et smarttab sw=4 tabstop=4: --&amp;gt;&lt;br/&gt;
&amp;lt;!--&lt;br/&gt;
Copyright &#169; 2016 AdvaOptical.com and others. All rights reserved.&lt;/p&gt;

&lt;p&gt;This program and the accompanying materials are made available under the&lt;br/&gt;
terms of the Eclipse Public License v1.0 which accompanies this distribution,&lt;br/&gt;
and is available at &lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;&lt;br/&gt;
--&amp;gt;&lt;br/&gt;
&amp;lt;blueprint xmlns=&quot;http://www.osgi.org/xmlns/blueprint/v1.0.0&quot;&lt;br/&gt;
  xmlns:odl=&quot;http://opendaylight.org/xmlns/blueprint/v1.0.0&quot;&lt;br/&gt;
  odl:use-default-for-reference-types=&quot;true&quot;&amp;gt;&lt;/p&gt;

&lt;p&gt;  &amp;lt;reference id=&quot;dataBroker&quot;&lt;br/&gt;
    interface=&quot;org.opendaylight.controller.md.sal.binding.api.DataBroker&quot;&lt;br/&gt;
    odl:type=&quot;default&quot; /&amp;gt;&lt;/p&gt;

&lt;p&gt;  &amp;lt;bean id=&quot;provider&quot;&lt;br/&gt;
    class=&quot;com.adva.ensemble.controller.impl.NormalizedNodeDemoProvider&quot;&lt;br/&gt;
    init-method=&quot;init&quot; destroy-method=&quot;close&quot;&amp;gt;&lt;br/&gt;
    &amp;lt;argument ref=&quot;dataBroker&quot; /&amp;gt;&lt;br/&gt;
  &amp;lt;/bean&amp;gt;&lt;/p&gt;

&lt;p&gt;  &amp;lt;bean id=&quot;rpcDemo&quot;&lt;br/&gt;
    class=&quot;com.adva.ensemble.controller.impl.NNRpcDemo&quot;&amp;gt;&lt;br/&gt;
  &amp;lt;/bean&amp;gt;&lt;/p&gt;

&lt;p&gt;  &amp;lt;odl:rpc-implementation ref=&quot;rpcDemo&quot; /&amp;gt;&lt;br/&gt;
&amp;lt;/blueprint&amp;gt;&lt;/p&gt;


&lt;p&gt;4. impl/src/main/java&lt;br/&gt;
     com.adva.ensemble.controller.impl.NNRpcDemo&lt;/p&gt;

&lt;p&gt;package com.adva.ensemble.controller.impl;&lt;/p&gt;

&lt;p&gt;import java.util.concurrent.Future;&lt;/p&gt;

&lt;p&gt;import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.normalizednodedemo.rev150105.NormalizednodedemoService;&lt;br/&gt;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.normalizednodedemo.rev150105.SayHelloInput;&lt;br/&gt;
import org.opendaylight.yangtools.yang.common.RpcResult;&lt;br/&gt;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;&lt;/p&gt;

&lt;p&gt;public class NNRpcDemo implements NormalizednodedemoService{&lt;/p&gt;

&lt;p&gt;    @Override&lt;br/&gt;
    public Future&amp;lt;RpcResult&amp;lt;Void&amp;gt;&amp;gt; sayHello(SayHelloInput input) &lt;/p&gt;
{

        return RpcResultBuilder.&amp;lt;Void&amp;gt;success().buildFuture();
    }

&lt;p&gt;}&lt;/p&gt;


&lt;p&gt;5. mvn clean install -Pq&lt;/p&gt;

&lt;p&gt;6. karaf/target/assembly&amp;gt; bin/karaf debug&lt;/p&gt;

&lt;p&gt;7. Launch APIDocs page: &lt;a href=&quot;http://localhost:8181/apidoc/explorer/index.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://localhost:8181/apidoc/explorer/index.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;    Invoke RPC : &lt;a href=&quot;http://localhost:8181/restconf/operations/normalizednodedemo:say-hello&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://localhost:8181/restconf/operations/normalizednodedemo:say-hello&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;    JSON :      {&lt;br/&gt;
		  &quot;input&quot;:{&lt;/p&gt;

&lt;p&gt;		  }&lt;br/&gt;
		}&lt;/p&gt;

&lt;p&gt;    RESPONSE : 200 &lt;br/&gt;
    RESPONSE CODE : No Content&lt;/p&gt;

&lt;p&gt;    NOTE: Mandatory attributes are not passed in the input.&lt;/p&gt;


&lt;p&gt;Thanks&lt;br/&gt;
Vikram&lt;/p&gt;</comment>
                            <comment id="44398" author="vdarsi@advaoptical.com" created="Tue, 28 Mar 2017 14:32:16 +0000"  >&lt;p&gt;screenshot is attached which shows RPC invocation success when mandatory attributes are not passed&lt;/p&gt;</comment>
                            <comment id="44399" author="vdarsi@advaoptical.com" created="Tue, 28 Mar 2017 14:32:16 +0000"  >&lt;p&gt;Attachment RPCInvocation.png has been added with description: RPCInvocation Image that is showing success when mandatory attrs are not passed&lt;/p&gt;</comment>
                            <comment id="66110" author="rovarga" created="Tue, 1 Jan 2019 16:14:25 +0000"  >&lt;p&gt;We will need to extract MandatoryLeafEnforcer &#8211; and probably some other portions of org.opendaylight.yangtools.yang.data.impl.schema.tree into yang-data-util where it would be usable by codecs.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                                                <inwardlinks description="is blocked by">
                                        <issuelink>
            <issuekey id="33836">YANGTOOLS-1259</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="13076" name="RPCInvocation.png" size="135985" author="vdarsi@advaoptical.com" created="Tue, 28 Mar 2017 14:32:16 +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_10208" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>External issue ID</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>8088</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=8088]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10206" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Issue Type</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10308"><![CDATA[New Feature]]></customfieldvalue>

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

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