-
Notifications
You must be signed in to change notification settings - Fork 119
Description
What happened?
In the spec module, the XXXRequest have different validation for the JSON-RPC methods:
if (jsonrpc == null || jsonrpc.isEmpty()) {
throw new IllegalArgumentException("JSON-RPC protocol version cannot be null or empty");
}
if (jsonrpc != null && !jsonrpc.equals(JSONRPC_VERSION)) {
throw new IllegalArgumentException("Invalid JSON-RPC protocol version");
}
Assert.checkNotNullParam("method", method);
if (!method.equals(METHOD)) {
throw new IllegalArgumentException("Invalid ListTasksRequest method");
}
Assert.checkNotNullParam("params", params);
Assert.isNullOrStringOrInteger(id); if (jsonrpc != null && ! jsonrpc.equals(JSONRPC_VERSION)) {
throw new IllegalArgumentException("Invalid JSON-RPC protocol version");
}
Assert.checkNotNullParam("method", method);
if (! method.equals(METHOD)) {
throw new IllegalArgumentException("Invalid GetAuthenticatedExtendedCardRequest method");
}
Assert.isNullOrStringOrInteger(id);
this.jsonrpc = Utils.defaultIfNull(jsonrpc, JSONRPC_VERSION);All request classes should use the same helper method to standardise the validation of the JSON-RPC spec in a consistent way
Relevant log output
Code of Conduct
- I agree to follow this project's Code of Conduct
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels