-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
serde compatibility could be extremely useful (like with ts_rs).
The 'Difference' macro should recognize some serde attributes (such as rename or rename_all) and add them to the resulting difference enum.
#[derive(Serialize, Deserialize, Difference)]
#[serde(rename_all(serialize = "camelCase"))]
#[difference(expose = "ExampleDiff")]
struct Example {
pub id: String,
pub date_of_birthday: String, // dateOfBirthday
#[serde(rename = "updatedAt")]
pub update: String, // updatedAt
}Given the previous example, the resulting ExampleDiff enum should have the attribute #[serde(rename_all(serialize = "camelCase"))] and its update variant the attribute #[serde(rename = "updatedAt")].
This ensures that the Example struct and ExampleDiff enum are in sync with their ser(de) counterparts.
Metadata
Metadata
Assignees
Labels
No labels