How can I avoid validating lref/when/must restriction when validating rpc?
If a rpc input leaf is a lref and it reference to a config or status node, it may be hard to get the value of such config or status node. In libyang1, there is an option to avoid such validation
#define LYD_OPT_NOEXTDEPS 0x8000 /**< Allow external dependencies (external leafrefs, instance-identifiers, must,
and when) to not be resolved/satisfied during validation. */
But it libyang2, I cannot find the alternative option. So how can I do it ?
In libyang v1 it was added out of necessity and bad design. Either validate the RPC normally or not at all, nothing else really makes sense.
Fine, but I think such requirement do indeed exist, which depens on the architecture of the concerned softwares. I have a server that receives rpc and then parse and validate it, after that, the server will dispatch the rpc to the apllications which subscribe such rpc. The server does not store any status. In such case, the server is not quit suitable to query the status infomation from applications. So I want to disable the validation for this leafref/when/must which refer to status node out of the rpc.
So do not validate it all, like I said.
But I want to validate the "mandatory"🤣
What problem would that solve? The only valid information you can have is whether the data are valid or invalid. Validating mandatory will not tell you it is either.