You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actual behavior
Explicit implementation of OnGetByKey handler within the node, causes the library panic during DELETE request handling if, OnDeleteByKey is not explicit implemented.
Expected behavior
Explicit implementation of OnGetByKey handler within the node, does NOT cause the library panic during DELETE request handling, if OnDeleteByKey is not explicit implemented
Reproduction steps Code used to reproduce the bug can be found in the section below
Start restconf server - go run main.go
Create more than 1 resource within the books Yang node (it is already done, by configuration within startup.json file)
Perform a DELETE request to delete 1 resource within the books node
Request: curl -X DELETE http://localhost:8080/restconf/data/library:books=0
Response: curl: (52) Empty reply from server
Server logs:
module library {
revision2024-10-03;
list books {
key book-id;
leaf book-id {
description"unique id for book";
typeint32;
}
leaf title {
description"title of the book";
typestring;
}
}
}
The only way I found to avoid it, is to implement an explicit OnDeleteByKey handler too. After that requested DELETE request is performed with no issues.
The text was updated successfully, but these errors were encountered:
Pawel-Guzik
changed the title
Explicit implementation of 'OnGetByKey' handler, causes panic during delete node operation if 'OnDeleteByKey' is not explicit implemented
Explicit implementation of 'OnGetByKey' handler, causes panic during delete node operation if 'OnDeleteByKey' is not explicitly implemented
Oct 3, 2024
Actual behavior
Explicit implementation of
OnGetByKey
handler within the node, causes the library panic duringDELETE
request handling if,OnDeleteByKey
is not explicit implemented.Expected behavior
Explicit implementation of
OnGetByKey
handler within the node, does NOT cause the library panic duringDELETE
request handling, ifOnDeleteByKey
is not explicit implementedReproduction steps
Code used to reproduce the bug can be found in the section below
go run main.go
books
Yang node (it is already done, by configuration withinstartup.json
file)books
nodeRequest:
curl -X DELETE http://localhost:8080/restconf/data/library:books=0
Response:
curl: (52) Empty reply from server
Server logs:
Code used to reproduce a bug
yang/library.yang
main.go
startup.json
Additional informations
go.mod
content:The only way I found to avoid it, is to implement an explicit
OnDeleteByKey
handler too. After that requestedDELETE
request is performed with no issues.The text was updated successfully, but these errors were encountered: