Open carlhua opened 4 years ago
++ better RPC validation - right now you can submit additional parameters without receiving errors, which could cause issues if you typo a param's name without realizing.
e.g. this still returns a normal server_info
output:
{
"command": "server_info",
"hello": "world"
}
We need to do for validating RPC inputs what we did for jtx testing. There should be a single validation function taking a variadic argument list that takes a sequence of validation predicates, evaluates them left to right with short circuiting. A failed predicate terminates the validation. The return value of validate offers enough information to report the problem to the caller and the human.
For example:
Consider:
Exported from RIPD-933