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
# Cargo.toml
[package]
name = "primitive-top-level"version = "0.1.0"edition = "2021"# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
serde_json = "1.0.91"serde_qs = "0.11.0"
Error: Custom("cannot deserialize primitive at the top level.Try deserializing into a struct.")
The text was updated successfully, but these errors were encountered:
Try deserializing into <HashMap<String, serde_json::Value>>
Edit: I ran into the same issue and I need the top level structure to be a serde_json::Value to be able to dynamically traverse the object tree by a given key.
My actual workaround is:
Summary
Cannot deserialize query string into dynamic objects such as
serde_json::Value
ortoml::Value
Current behaviour
Deserialization fails. Serialization succeeds
Expected behaviour
Serialization and deserialization shouldn't fail on dynamic objects.
Minimal example
The text was updated successfully, but these errors were encountered: