set enum variant serialization names
This commit is contained in:
parent
c2306c9709
commit
ea4320cfb5
2 changed files with 122 additions and 0 deletions
|
@ -134,6 +134,9 @@ pub fn create_enum(
|
|||
match variant {
|
||||
serde_json::Value::String(s) => {
|
||||
let variant_name = s.to_pascal_case();
|
||||
variants.push_str("#[serde(rename = \"");
|
||||
variants.push_str(s);
|
||||
variants.push_str("\")]");
|
||||
variants.push_str(&variant_name);
|
||||
variants.push_str(",\n");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue