Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(email-service): Swagger typegen fix (#885)

Evan Hutnika3b8ab9c2534
diff --git a/rust/cloud-storage/email_service/src/api/email/drafts/add_attachment.rs b/rust/cloud-storage/email_service/src/api/email/drafts/add_attachment.rs
index b840188989..caf447f3a7 100644
--- a/rust/cloud-storage/email_service/src/api/email/drafts/add_attachment.rs
+++ b/rust/cloud-storage/email_service/src/api/email/drafts/add_attachment.rs
@@ -12,7 +12,7 @@ use models_email::service::link::Link;
use std::str::FromStr;
use strum_macros::AsRefStr;
use thiserror::Error;
-use utoipa::ToSchema;
+use utoipa::{IntoParams, ToSchema};
use uuid::Uuid;
#[derive(Debug, Error, AsRefStr)]
@@ -45,8 +45,9 @@ impl IntoResponse for AddDraftAttachmentError {
}
}
-#[derive(serde::Serialize, serde::Deserialize, Debug)]
+#[derive(serde::Serialize, serde::Deserialize, Debug, IntoParams)]
pub struct PathParams {
+ /// The ID of the draft to add the attachment to.
pub id: Uuid,
}
@@ -77,6 +78,7 @@ pub struct AddDraftAttachmentResponse {
tag = "Drafts",
path = "/email/drafts/{id}/attachments",
operation_id = "add_draft_attachment",
+ params(PathParams),
request_body = AddDraftAttachmentRequest,
responses(
(status = 201, body = AddDraftAttachmentResponse),
diff --git a/rust/cloud-storage/email_service/src/api/email/drafts/remove_attachment.rs b/rust/cloud-storage/email_service/src/api/email/drafts/remove_attachment.rs
index 8049fffee9..bddbabfd37 100644
--- a/rust/cloud-storage/email_service/src/api/email/drafts/remove_attachment.rs
+++ b/rust/cloud-storage/email_service/src/api/email/drafts/remove_attachment.rs
@@ -8,6 +8,7 @@ use model::response::{EmptyResponse, ErrorResponse};
use models_email::service::link::Link;
use strum_macros::AsRefStr;
use thiserror::Error;
+use utoipa::IntoParams;
use uuid::Uuid;
#[derive(Debug, Error, AsRefStr)]
@@ -40,9 +41,11 @@ impl IntoResponse for RemoveDraftAttachmentError {
}
}
-#[derive(serde::Serialize, serde::Deserialize, Debug)]
+#[derive(serde::Serialize, serde::Deserialize, Debug, IntoParams)]
pub struct PathParams {
+ /// The ID of the draft to remove the attachment from.
pub id: Uuid,
+ /// The ID of the attachment to remove.
pub attachment_id: Uuid,
}
@@ -52,6 +55,7 @@ pub struct PathParams {
tag = "Drafts",
path = "/email/drafts/{id}/attachments/{attachment_id}",
operation_id = "remove_draft_attachment",
+ params(PathParams),
responses(
(status = 201, body = EmptyResponse),
(status = 400, body = ErrorResponse),