Skip to content

Commit fddafe0

Browse files
committed
json: Set field names to kebab case
1 parent 8b96cb7 commit fddafe0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/json_data.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use serde::{Deserialize, Serialize};
1111
#[derive(Debug, Clone, From, TryInto)]
1212
#[cfg_attr(feature = "json", derive(Deserialize, Serialize))]
1313
#[cfg_attr(feature = "json", serde(tag = "unit", content = "tree"))]
14+
#[cfg_attr(feature = "json", serde(rename_all = "kebab-case"))]
1415
pub enum UnitAndTree {
1516
/// Tree where data is [bytes](Bytes).
1617
Bytes(Reflection<String, Bytes>),
@@ -22,6 +23,7 @@ pub enum UnitAndTree {
2223
/// input of the program with `--json-input` flag.
2324
#[derive(Debug, Clone)]
2425
#[cfg_attr(feature = "json", derive(Deserialize, Serialize))]
26+
#[cfg_attr(feature = "json", serde(rename_all = "kebab-case"))]
2527
pub struct JsonData {
2628
/// The `"unit"` field and the `"tree"` field.
2729
#[cfg_attr(feature = "json", serde(flatten))]

0 commit comments

Comments
 (0)