Skip to content

Commit 0f2f0d9

Browse files
committed
Fix TruncationDirection with serde alias instead
With `#[serde(alias = "...", ...)]` we wouldn't break anything user-wise, whilst allowing for both "left"/"Left" and "right"/"Right" to be provided as `truncation_direction` other than only the capitalized version of those
1 parent 5aa761f commit 0f2f0d9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

router/src/http/types.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,10 @@ impl<'__s> ToSchema<'__s> for PredictInput {
194194
}
195195

196196
#[derive(Debug, Clone, Copy, PartialEq, Deserialize, ToSchema, Eq, Default)]
197-
#[serde(rename_all = "lowercase")]
198197
pub(crate) enum TruncationDirection {
198+
#[serde(alias = "left", alias = "Left")]
199199
Left,
200+
#[serde(alias = "right", alias = "Right")]
200201
#[default]
201202
Right,
202203
}

0 commit comments

Comments
 (0)