MindFlavor/AzureSDKForRust

azure_sdk_aad_auth: json deserialization crash

jefshe opened this issue · 1 comments

Making any auth request results in a json error from serde:

Err` value: reqwest::Error { kind: Decode, source: Error("invalid type: map, expected a string", line: 1, column: 0) }', src/libcore/result.rs:1165:5

I think it's coming from the string deserializer here:

impl<'de> Deserialize<'de> for LoginResponse {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
        where
            D: Deserializer<'de>,
    {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(de::Error::custom)
    }

Probably there is a change in behaviour with serde_json where the string deserializer will refuse to deserialize unquoted json objects as strings

I've merged your code and it seems great!
I'm closing this for the time being.