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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user