I have an API that response an array JSON in format:
[
{
"key1": "value1", // etc
}
]
Now I use reqwest to get the API data and handle the response into a Vec<ResponseTags>, the struct will contains every key in the object of the object array. I encapsualate the reqwest with proxy settings in the client, it can get the response successfully.
How can I transform the JSON
[
{
"key1": "value1", // etc
}
]
into Vec<ResponseTags> like
let tags: Vec<ResponseTags> = reqwest::get(url).await?.json().await?;// Something like the code to do deserialization and deseriliaze the object array JSON into this
pub struct ResponseTags {
pub key1: String, //etc
}
?