A small extension to serde that will allow you to use the macro #[prefix_all("myprefix_")
. The macro will prefix each attribute in a struct or enum with the prefix of your choice.
Behind the doors it's using #[serde(rename = "...")]
to rename each attribute with the prefix defined in prefix_all.
```rust
extern crate serde_prefix; extern crate serde;
use serde::{Serialize, Deserialize};
struct Point { x: i32, y: i32 }
let point = Point { x: 1, y: 2 }; let serialized = serdejson::tostring(&point).unwrap(); let json = r#"{"testx":1,"testy":2}"#; assert_eq!(serialized, json); ```
If there is anything that you are missing create an issue :).