From 6873841ba4c20094087050eb2ac6a77cfc4fa40f Mon Sep 17 00:00:00 2001 From: Michel-Marie MAUDET Date: Fri, 22 May 2026 23:14:01 +0200 Subject: [PATCH] fix(search): expose new SortBy variants via #[oai(rename)] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit InternalDate and IngestAt were renamed for the wire with #[serde(rename)] only. SortBy derives poem_openapi::Enum, which does not honour serde attributes, so the REST deserializer exposed them under their Rust identifiers instead of the intended INTERNAL_DATE / INGEST_AT — inconsistent with the existing DATE/SIZE values and rejecting the documented names with HTTP 400. Add #[oai(rename = ...)] alongside the serde rename. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/core/src/message/search.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/core/src/message/search.rs b/crates/core/src/message/search.rs index 2efc43d..910fc15 100644 --- a/crates/core/src/message/search.rs +++ b/crates/core/src/message/search.rs @@ -74,9 +74,11 @@ pub enum SortBy { SIZE, /// Sort by the IMAP server INTERNALDATE timestamp. #[serde(rename = "INTERNAL_DATE")] + #[cfg_attr(feature = "web-api", oai(rename = "INTERNAL_DATE"))] InternalDate, /// Sort by Bichon's archival (ingest) timestamp. #[serde(rename = "INGEST_AT")] + #[cfg_attr(feature = "web-api", oai(rename = "INGEST_AT"))] IngestAt, }