summaryrefslogtreecommitdiffstats
path: root/generator
diff options
context:
space:
mode:
authorCyborus <cyborus@cyborus.xyz>2024-03-15 21:06:49 +0100
committerCyborus <cyborus@cyborus.xyz>2024-03-15 21:06:49 +0100
commitea4320cfb54d84211e11b14b7b0bb5f92184b691 (patch)
tree50c40356610fb12214868b7ecf8e3f07b2aabc8d /generator
parentupdate tests (diff)
downloadforgejo-api-ea4320cfb54d84211e11b14b7b0bb5f92184b691.tar.xz
forgejo-api-ea4320cfb54d84211e11b14b7b0bb5f92184b691.zip
set enum variant serialization names
Diffstat (limited to 'generator')
-rw-r--r--generator/src/structs.rs3
1 files changed, 3 insertions, 0 deletions
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");