Category "serde-json"

Serialize/Deserialize json array to struct

I have incoming data in a json array that I deserialize into a struct, but I can't seem figure out how to serialize it back into an array instead of an object.

Deserialize using a function of the tag

An API with this internally tagged field structure, with "topic" being the tag: { "topic": "Car" "name": "BMW" "HP": 250 } This can be deserialized

Can you deserialize a struct from a map or a string?

Consider this Config struct which contains a vector of Host structs: use serde::Deserialize; use std::net::IpAddr; #[derive(Debug, Deserialize)] struct Config

How can I deserialize a type where all the fields are default values as a None instead?

I have to deserialize JSON blobs where in some places the absence of an entire object is encoded as an object with the same structure but all of its fields set