From c9076fac8e3748597a5f31544e78f17f7354d4b9 Mon Sep 17 00:00:00 2001 From: Manuel Holtgrewe Date: Mon, 20 Nov 2023 11:50:40 +0100 Subject: [PATCH] feat: serializing record enums with snake_case (#302) --- src/freqs/cli/query.rs | 2 ++ src/gnomad_sv/cli/query.rs | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/freqs/cli/query.rs b/src/freqs/cli/query.rs index c7dc9e84..0bf96d4f 100644 --- a/src/freqs/cli/query.rs +++ b/src/freqs/cli/query.rs @@ -86,6 +86,8 @@ pub fn open_rocksdb_from_args( } /// Enumeration of possible result records. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "snake_case")] pub enum Record { /// Record for autosomal variant. Autosomal(freqs::serialized::auto::Record), diff --git a/src/gnomad_sv/cli/query.rs b/src/gnomad_sv/cli/query.rs index 14aa3521..c0755894 100644 --- a/src/gnomad_sv/cli/query.rs +++ b/src/gnomad_sv/cli/query.rs @@ -111,7 +111,8 @@ pub fn open_rocksdb_from_args( } /// Enumeration for the different record types that we have. -#[derive(Debug)] +#[derive(Debug, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "snake_case")] pub enum Record { /// ExAC SV record. ExacCnv(crate::gnomad_pbs::exac_cnv::Record),