You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We define a newtype, in this case with nutype macro and we are going to use it as part of a struct:
use nutype::nutype;#[nutype( sanitize(trim, lowercase), derive(Serialize,Deserialize))]pubstructEmail(String);#[derive(Serialize,Deserialize)]pubstructSignInReq{email:Email,// ...}
Now when we are trying to deserialize a qs string, something like req[email][email protected], it returns error Err(Deserialization(Custom("invalid type: sequence, expected tuple struct Email"))).
The text was updated successfully, but these errors were encountered:
I just found out that string newtypes are considered sequences with single element. Is it intentional?
serde_qs/src/de/mod.rs
Lines 629 to 633 in b7278b7
Please consider the following case:
We define a newtype, in this case with
nutype
macro and we are going to use it as part of a struct:Now when we are trying to deserialize a qs string, something like
req[email][email protected]
, it returns errorErr(Deserialization(Custom("invalid type: sequence, expected tuple struct Email")))
.The text was updated successfully, but these errors were encountered: