Make Response::into_json deserialize into a serde DeserializeOwned
This removes the necessity to take the result of Response::into_json and having to convert it into a struct by using serde_json::from_value This adds no new dependencies since serde_json already depends on serde. Users of ureq will have to include `serde_derive` either by importing it directly or by using serde with the `derive` feature, unless they want to manually implement `Deserialize` on their structs.
This commit is contained in:
committed by
Martin Algesten
parent
8f2d094cef
commit
0b69c595b6
@@ -15,7 +15,7 @@ all-features = true
|
||||
|
||||
[features]
|
||||
default = ["tls", "cookies"]
|
||||
json = ["serde_json"]
|
||||
json = ["serde", "serde_json"]
|
||||
charset = ["encoding"]
|
||||
tls = ["rustls", "webpki", "webpki-roots"]
|
||||
native-certs = ["rustls-native-certs"]
|
||||
@@ -34,5 +34,9 @@ rustls = { version = "0.17", optional = true, features = [] }
|
||||
webpki = { version = "0.21", optional = true }
|
||||
webpki-roots = { version = "0.19", optional = true }
|
||||
rustls-native-certs = { version = "0.3", optional = true }
|
||||
serde = { version = "1", optional = true }
|
||||
serde_json = { version = "1", optional = true }
|
||||
encoding = { version = "0.2", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
|
||||
Reference in New Issue
Block a user