refactor: Conditionalize utoipa and flate2 based on features

Conditionalize `utoipa::ToSchema` derives and `#[schema]` attributes on the `server` feature, and `flate2` usage on the `gzip` feature, allowing compilation when these features are disabled.

Co-authored-by: aider (openai/andrew/openrouter/sonoma-sky-alpha) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-09-10 17:21:48 -03:00
parent 8848227837
commit 6a4936d8d4
4 changed files with 39 additions and 7 deletions

View File

@@ -153,15 +153,24 @@ pub struct CompressionPluginConfig {
pub name: String,
}
#[derive(Debug, Clone, Deserialize, Serialize, utoipa::ToSchema)]
#[derive(Debug, Clone, Deserialize, Serialize, #[cfg(feature = "server")] utoipa::ToSchema)]
#[cfg_attr(not(feature = "server"), derive(Debug, Clone, Deserialize, Serialize))]
pub struct MetaPluginConfig {
pub name: String,
#[cfg(feature = "server")]
#[schema(value_type = Object)]
#[serde(default)]
pub options: std::collections::HashMap<String, serde_yaml::Value>,
#[cfg(not(feature = "server"))]
#[serde(default)]
pub options: std::collections::HashMap<String, serde_yaml::Value>,
#[cfg(feature = "server")]
#[schema(value_type = Object)]
#[serde(default)]
pub outputs: std::collections::HashMap<String, String>,
#[cfg(not(feature = "server"))]
#[serde(default)]
pub outputs: std::collections::HashMap<String, String>,
}
/// Unified settings that merges config file and CLI arguments