Try RPC serialization first with params
@@ -533,6 +533,8 @@ impl<'de, T: Deserialize<'de>> Deserialize<'de> for EditCommand<T>
let mut v = Value::deserialize(deserializer)?;
let helper = InnerId::deserialize(&v).map_err(de::Error::custom)?;
let InnerId { view_id } = helper;
+
+ if T::deserialize(v.clone()).is_err() {
// if params are empty, remove them
let remove_params = match v.get("params") {
Some(&Value::Object(ref obj)) => obj.is_empty(),
@@ -544,6 +546,7 @@ impl<'de, T: Deserialize<'de>> Deserialize<'de> for EditCommand<T>
if remove_params {
v.as_object_mut().map(|v| v.remove("params"));
}
+ }
let cmd = T::deserialize(v).map_err(de::Error::custom)?;
Ok(EditCommand { view_id, cmd })
