I'd like to use this crate's serde_value::Value as a more generic version of serde_json::Value.
My use case is an HTTP API where the success response body is defined as such:
#[derive(serde::Serialize)]
struct SuccessBody {
data: serde_json::Value,
}
impl SuccessBody {
pub fn new(data: impl Into<serde_json::Value>) -> Self {
let data = data.into();
Self { data }
}
}
I'd like to use this crate's
serde_value::Value
as a more generic version ofserde_json::Value
. My use case is an HTTP API where the success response body is defined as such:Since most (all?)
serialize_*
are infallible, e.g: https://github.com/arcnmx/serde-value/blob/47190f5a90c0fee90b6e819284801fe7be1df8c3/src/ser.rs#L77-L87 this should be trivial to implement.I can submit a PR if you believe this is worth implementing.