use std::collections::HashMap;
use serde::{Deserialize, Serialize};
use crate::impl_visitable_noop;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[cfg_attr(feature = "schema", schemars(deny_unknown_fields))]
#[serde(rename_all = "camelCase")]
pub struct CatalogEntry {
pub entry_type: CatalogEntryType,
pub entry_id: String,
#[serde(deserialize_with = "crate::utils::deserialize_map_without_null_values")]
pub entry_text: HashMap<String, Vec<String>>,
pub article_id: String,
pub entries: Vec<CatalogEntry>,
}
impl_visitable_noop!(CatalogEntry);
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
pub enum CatalogEntryType {
Folder,
Article,
}