use serde::{Deserialize, Serialize};
use super::Schema;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AnyOfSchema {
pub name: String,
pub description: Option<String>,
pub schemas: Vec<Schema>,
}
impl AnyOfSchema {
pub fn new(name: impl Into<String>, schemas: impl IntoIterator<Item = Schema>) -> Self {
Self {
name: name.into(),
description: None,
schemas: schemas.into_iter().collect(),
}
}
pub fn with_description(mut self, description: impl Into<String>) -> Self {
self.description = Some(description.into());
self
}
}