[NETCONF-1023] OpenAPI: Limit usage of JsonUtil#copy method Created: 10/May/23 Updated: 14/Jun/23 Resolved: 23/May/23 |
|
| Status: | Resolved |
| Project: | netconf |
| Component/s: | restconf-openapi |
| Affects Version/s: | None |
| Fix Version/s: | 6.0.0 |
| Type: | Improvement | Priority: | Medium |
| Reporter: | Ivan Hrasko | Assignee: | Oleksandr Zharov |
| Resolution: | Done | Votes: | 0 |
| Labels: | pt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
The addPaths method is the only place where we need to make a copy of parameters because we are going deeper into recursion. Thus we need The other methods buildPost, buildGet, buildPut and buildDelete are doing unnecessary copying. The second problem is that we do not have any unit test to check the number of parameters in recursive models, for example: container container-root {
list root-list {
key name;
leaf name {
type string;
} list nested-list {
key name;
leaf name {
type string;
} list super-nested-list {
key name;
leaf name {
type string;
}
}
}
}
}
|
| Comments |
| Comment by Ivan Hrasko [ 22/May/23 ] |
|
We have found out that we cannot get rid of copying. But we can use ArrayNode#addAll instead of JsonUtil#copy. |