From 5aa761fa4d18049ddd350bea627a90db8521625b Mon Sep 17 00:00:00 2001 From: Alvaro Bartolome <36760800+alvarobartt@users.noreply.github.com> Date: Tue, 11 Nov 2025 23:01:57 +0900 Subject: [PATCH 1/2] Fix `TruncationDirection` by renaming to lowercase --- router/src/http/types.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/router/src/http/types.rs b/router/src/http/types.rs index dedaab60..c1df99f8 100644 --- a/router/src/http/types.rs +++ b/router/src/http/types.rs @@ -194,6 +194,7 @@ impl<'__s> ToSchema<'__s> for PredictInput { } #[derive(Debug, Clone, Copy, PartialEq, Deserialize, ToSchema, Eq, Default)] +#[serde(rename_all = "lowercase")] pub(crate) enum TruncationDirection { Left, #[default] From 0f2f0d94e9d97930104b660aa23733a4a70937a7 Mon Sep 17 00:00:00 2001 From: Alvaro Bartolome <36760800+alvarobartt@users.noreply.github.com> Date: Thu, 13 Nov 2025 13:12:36 +0900 Subject: [PATCH 2/2] 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 --- router/src/http/types.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/router/src/http/types.rs b/router/src/http/types.rs index c1df99f8..a2a01c47 100644 --- a/router/src/http/types.rs +++ b/router/src/http/types.rs @@ -194,9 +194,10 @@ impl<'__s> ToSchema<'__s> for PredictInput { } #[derive(Debug, Clone, Copy, PartialEq, Deserialize, ToSchema, Eq, Default)] -#[serde(rename_all = "lowercase")] pub(crate) enum TruncationDirection { + #[serde(alias = "left", alias = "Left")] Left, + #[serde(alias = "right", alias = "Right")] #[default] Right, }