Failing to deserialize after converting to `serde_json::value::Value`.
pinkisemils opened this issue · comments
Emīls Piņķis commented
As it stands, deserializing ipnetwork::IpNetwork
into a serde_json::value::Value
will make it fail to deserialize into ipnetwork::IpNetwork
.
let network = IpNetwork::from_str("0.0.0.0/0").unwrap();
let value: serde_json::value::Value = serde_json::from_str(&serde_json::to_string(&network).unwrap()).unwrap();
let _: IpNetwork = serde_json::from_value(value).expect("Actually fails to deserialize");
This might be a serde
related issue, but it'd be great if this could be worked around, as currently this issue implies that one can't use ipnetwork::IpNetwork
in requests and responses with libraries such as jsonrpc-core
.