ConfD ignores duplicate value of item in a restconf body

Hello Folks,

when i send duplicate data in the body of post request in restconf, confd ignores duplicate item. it considers one item. That is good, but this behavior is optional ? can i change this behavior ?

here is the sample body data:
{
“routers”: [“192.168.1.3”, “192.168.1.3”, “192.168.1.3”],
}

confD ignores duplicate values and it just takes one ip address. it’s “192.168.1.3”

Many Thanks,
With My Best Regards

That behavior is not optional, and the reason is that it is not ConfD invention, this is how the standards require ConfD to behave. The routers element is obviously a leaf-list, and it is a hard requirement that values in a leaf-list must be unique.

You can change your data model though and model routers as a list keyed by an sequence number or a name or the like, with a leaf ip-address; in such case the addresses can duplicate as you please.