openconfiguration/
catalog_entry.rs1use std::collections::HashMap;
2
3use serde::{Deserialize, Serialize};
4
5use crate::impl_visitable_noop;
6
7#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
8#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
9#[cfg_attr(feature = "schema", schemars(deny_unknown_fields))]
10#[serde(rename_all = "camelCase")]
11pub struct CatalogEntry {
12 pub entry_type: CatalogEntryType,
13 pub entry_id: String,
15 #[serde(deserialize_with = "crate::utils::deserialize_map_without_null_values")]
17 pub entry_text: HashMap<String, Vec<String>>,
18 pub article_id: String,
20 pub entries: Vec<CatalogEntry>,
22}
23
24impl_visitable_noop!(CatalogEntry);
25
26#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
27#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
28pub enum CatalogEntryType {
29 Folder,
30 Article,
31}