[YANGTOOLS-249] Yangtools Mangling REST names Created: 05/Aug/14  Updated: 10/Apr/22  Resolved: 06/Aug/14

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

Type: Bug
Reporter: Reinaldo Penno Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Mac OS
Platform: PC


Attachments: File mod-test-cont.yang     File oneM2Mv2.yang    
External issue ID: 1483

 Description   

I have the following model

container CSEBase {
description "Resource at the root of the tree";
container CSEBaseAttributes {
description "all attributes of CSEBase are in this container";
uses commonAttributesGroup;
leaf cseID

{ type string; description "The globally unique CSE identifier."; mandatory true; }

I noticed that the container name "CSEBaseAttributes" was changed to "Attributes". I was trying a JSON PUT for quite some time and RESTconf API explorer showed the actual URI

{
"CSEBase": {
"Attributes":

{ "cseID": "CSE-Id-Reinaldo" }

}
}

Without a tool like RESTconf API explorer I would never know that this mangling happened and to what name it was changed exactly. I checked RESTconf draft and the name CSEBaseAttributes is allowed. Maybe having the name prefix as the module is the problem.



 Comments   
Comment by Ladislav Borak [ 05/Aug/14 ]

I tested behavior of changing container name, with model included as attachment and all works fine. Tested with current controller in debug mode, from postman and also with RESTConf API Explorer. All operations works correctly and containers name stayed the same.

Comment by Ladislav Borak [ 05/Aug/14 ]

Attachment mod-test-cont.yang has been added with description: test yang file

Comment by Reinaldo Penno [ 05/Aug/14 ]

I'm attaching the Yang model that caused the problem.

Comment by Reinaldo Penno [ 05/Aug/14 ]

Attachment oneM2Mv2.yang has been added with description: Yang model that caused the problem

Comment by Ladislav Borak [ 05/Aug/14 ]

Your included yang file is not valid.

At first sight I found out some problems:

1) number of left and right braces is not same (line 332)
2) leaf stateTag cannot contains both mandatory and default statement (line 117)
3) incorrect identifier for type (line 298)
4) leaf maxInstanceAge decalred twice (line 234)
5) leaf currentNrOfInstances declared twice
6) leaf currentByteSize declared twice
7) incorrect leafref target
/resourceSubscription/resourceSubscriptionAttributes/attributes/resourceID

and more.

Please use valid yang file and try to test again.

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