From ea4320cfb54d84211e11b14b7b0bb5f92184b691 Mon Sep 17 00:00:00 2001 From: Cyborus Date: Fri, 15 Mar 2024 16:06:49 -0400 Subject: set enum variant serialization names --- generator/src/structs.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'generator') diff --git a/generator/src/structs.rs b/generator/src/structs.rs index 7daa8d4..6f2e917 100644 --- a/generator/src/structs.rs +++ b/generator/src/structs.rs @@ -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"); -- cgit v1.2.3