[YANGTOOLS-584] DESCRIPTION is not valid for INPUT or OUTPUT. Created: 18/Feb/16  Updated: 10/Apr/22  Resolved: 18/Feb/16

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: zhuweisheng Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 5379

 Description   

I am getting Error when trying to parse a yang file.

my yang is:
module zws {
namespace "a:b:c";
prefix zws;
revision 2010-09-24

{ description "Initial revision."; }

rpc method1 {
input {
description "input des.";
leaf param

{ type string; }
}
output {
description "output des.";
leaf param { type string; }

}
}
}

the error is:
10:55:18.052 [main] WARN o.o.y.y.p.i.YangStatementParserListenerImpl - DESCRIPTION is not valid for INPUT. Error in module zws (QNameModule

{ns=a:b:c, rev=2010-09-24}

)
org.opendaylight.yangtools.yang.parser.spi.meta.InvalidSubstatementException: DESCRIPTION is not valid for INPUT. Error in module zws (QNameModule

{ns=a:b:c, rev=2010-09-24}

)
at org.opendaylight.yangtools.yang.parser.spi.SubstatementValidator.validate(SubstatementValidator.java:92) ~[classes/:na]
...
10:55:18.053 [main] WARN o.o.y.y.p.i.YangStatementParserListenerImpl - DESCRIPTION is not valid for OUTPUT. Error in module zws (QNameModule

{ns=a:b:c, rev=2010-09-24}

)
org.opendaylight.yangtools.yang.parser.spi.meta.InvalidSubstatementException: DESCRIPTION is not valid for OUTPUT. Error in module zws (QNameModule

{ns=a:b:c, rev=2010-09-24}

)
at org.opendaylight.yangtools.yang.parser.spi.SubstatementValidator.validate(SubstatementValidator.java:92) ~[classes/:na]
...

I think there may be have descriptions in the input or ouput node of rpc method. This may be a bug, there may be something wrong in the code of yangtools project.



 Comments   
Comment by Tony Tkacik [ 18/Feb/16 ]

I see why it makes tempting to have description in input / output,
but RFC6020 actually does not allow it.

See:
https://tools.ietf.org/html/rfc6020#section-7.13.2.1
https://tools.ietf.org/html/rfc6020#section-7.13.3.1

Description to input / output will not be even added in YANG 1.1 (see
https://tools.ietf.org/html/draft-ietf-netmod-rfc6020bis-09#section-7.14.2 ).

If you think about it, it actually makes sense - you describe whole rpc
and input, output are there only to model data of rpc.

Comment by zhuweisheng [ 18/Feb/16 ]

Sorry, I neglect. Yes, I agree with that. Thanks!

Generated at Wed Feb 07 20:53:40 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.