You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently RpcParams is just using serde_json::from_str, which creates two problems:
There is no way to handle deserializing a tuple with optional params, e.g.: (A, Option<B>) from json ["some type that creates A"].
It is technically possible to allow param types other than those allowed in the spec ("params" must be either null, an object with named params, or an array).
One way to do that would be to create tuple types for different numbers of params (Params1<A>(A), Params2<A, B>(A, B), etc., up to some fixed limit like 10), and then manually implementing Deserialize on them (with macros for all the variants). This would also remove the need to have RpcParams::one separate from RpcParams::parse.
The text was updated successfully, but these errors were encountered:
Currently
RpcParams
is just usingserde_json::from_str
, which creates two problems:(A, Option<B>)
from json["some type that creates A"]
."params"
must be eithernull
, an object with named params, or an array).One way to do that would be to create tuple types for different numbers of params (
Params1<A>(A)
,Params2<A, B>(A, B)
, etc., up to some fixed limit like 10), and then manually implementingDeserialize
on them (with macros for all the variants). This would also remove the need to haveRpcParams::one
separate fromRpcParams::parse
.The text was updated successfully, but these errors were encountered: