[NETCONF-1178] POST request with insert parameter fails if target URI points the list Created: 05/Oct/23 Updated: 24/Nov/23 |
|
| Status: | In Progress |
| Project: | netconf |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.0.0 |
| Type: | Bug | Priority: | Medium |
| Reporter: | Yaroslav Lastivka | Assignee: | Samuel Schneider |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | pick-next, pt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Description |
|
POST requests inherently operate on parent resources in the path. This makes it impossible to utilize the `insert` query parameter in the desired manner. curl --location --request POST 'http://localhost:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=17830-sim-device/yang-ext:mount/user-ordered-list:root?insert=last' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic YWRtaW46YWRtaW4=' \
--header 'Cookie: JSESSIONID=node01orql8nxe3xvz18848b91d7c1z1.node0' \
--data-raw '{
"user-ordered-list:items": [
{
"id": 1,
"name": "name"
}
]
}'
Error Received: {
"errors": {
"error": [
{
"error-tag": "bad-element",
"error-message": "Insert parameter can be used only with list or leaf-list",
"error-type": "protocol"
}
]
}
}
A similar situation arises when using a list as the parent resource. In this case, the application assigns the insert parameter to the parent list and demands an ordered-by-user statement. |
| Comments |
| Comment by Ruslan Kashapov [ 15/Nov/23 ] |
|
seems copy paste issue from PUT case see RestconfStrategy.java#L386 the path already points to parent element, no reason taking parent of parent, |