serde_alias

Crates.ioserde_alias
lib.rsserde_alias
version0.0.2
sourcesrc
created_at2020-12-04 13:41:09.336839
updated_at2020-12-04 16:01:32.598296
descriptionAn attribute macro to apply serde aliases to all struct fields
homepage
repositoryhttps://github.com/petar-dambovaliev/serde_alias
max_upload_size
id319633
size8,909
Petar Dambovaliev (petar-dambovaliev)

documentation

README

serde_alias

An attribute macro to add deserializing serde casing aliases for all fields in a struct

Simply list which aliase casing types should be applied

extern crate serde_alias;

use serde::{Deserialize};
use serde_alias::serde_alias;

#[serde_alias(
    CamelCase,
    PascalCase,
    LowerCase,
    UpperCase,
    SnakeCase,
    ScreamingSnakeCase,
    KebabCase,
    ScreamingKebabCase
)]
#[derive(Deserialize)]
struct Foo {
    bar: String,
}
Commit count: 9

cargo fmt