1
0
Fork 0

set enum variant serialization names

This commit is contained in:
Cyborus 2024-03-15 16:06:49 -04:00
parent c2306c9709
commit ea4320cfb5
No known key found for this signature in database
2 changed files with 122 additions and 0 deletions

View file

@ -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");