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:
@@ -40,11 +40,15 @@ pub use strip_ansi::StripAnsiFilter;
|
||||
/// * `name` - Option name.
|
||||
/// * `default` - Optional default value.
|
||||
/// * `required` - If true, must be provided.
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, utoipa::ToSchema)]
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, #[cfg(feature = "server")] utoipa::ToSchema)]
|
||||
#[cfg_attr(not(feature = "server"), derive(Debug, Clone, serde::Serialize, serde::Deserialize))]
|
||||
pub struct FilterOption {
|
||||
pub name: String,
|
||||
#[cfg(feature = "server")]
|
||||
#[schema(value_type = Option<Object>)]
|
||||
pub default: Option<serde_json::Value>,
|
||||
#[cfg(not(feature = "server"))]
|
||||
pub default: Option<serde_json::Value>,
|
||||
pub required: bool,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user