-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
7.0.0
-
None
Leaf-list resource creation fails due to min-element condition violation, even when the number of leaf-list elements is correct.
Steps to reproduce:
1) Add "test-container-childs" model to netconf-testtool
module test-container-childs { namespace "http://example.com/test/container/child"; prefix "tcc"; revision 2023-09-28; container root-leaf-list-container { container nested-leaf-list-container { leaf-list leaf-list-with-min-elements { min-elements 1; max-elements 3; type string; } } } }
2) Send a request to populate "leaf-list-with-min-elements"
POST URI: rests/data/network-topology:network-topology/topology=topology-netconf/node=36001-sim-device/yang-ext:mount/test-container-childs:root-leaf-list-container/nested-leaf-list-container Payload: { "leaf-list-with-min-elements": [ "data1", "data2" ] }
3) Response from device:
{ "errors": { "error": [ { "error-tag": "operation-failed", "error-info": "TransactionCommitFailedException{message=Netconf transaction commit failed, errorList=[RpcError [message=Netconf transaction commit failed, severity=ERROR, errorType=APPLICATION, tag=operation-failed, applicationTag=null, info=null, cause=NetconfDocumentedException{error-type=APPLICATION, error-tag=operation-failed, error-severity=ERROR, error-info={}, message=RPC during tx failed. Transaction commit failed on TransactionCommitFailedException{message=preCommit execution failed, errorList=[RpcError [message=preCommit execution failed, severity=ERROR, errorType=APPLICATION, tag=operation-failed, applicationTag=null, info=null, cause=org.opendaylight.yangtools.yang.data.tree.impl.MinMaxElementsValidationFailedException: (http://example.com/test/container/child?revision=2023-09-28)leaf-list-with-min-elements does not have enough elements (0), needs at least 1]]} 1 Cause: preCommit execution failed }]]}", "error-message": "Transaction(POST) not committed correctly", "error-type": "application" } ] } }