I currently have a JSON string I am deserializing with serde_json.
{
"foo": "<val>" // val can contain "SI" or "NO"
}
I would like to deserialize this to a bool using serde and a custom lookup that turns "SI" -> true and vice-versa.
#[derive(Deserialize)]
pub struct Entry {
pub foo: bool, // How to express string to bool deserialization ?
}
How can I do that simply ?