This commit is contained in:
2022-07-10 06:04:46 +00:00
committed by GitHub
parent 3e796eee62
commit 427cc0ebc2

View File

@@ -1,6 +1,9 @@
use super::super::check::CheckUnkown;
use super::super::error::FanboxAPIError;
use super::block::FanboxArticleBlock;
use crate::fanbox_api::FanboxClientInternal;
use json::JsonValue;
use proc_macros::check_json_keys;
use std::fmt::Debug;
use std::sync::Arc;
@@ -36,6 +39,21 @@ impl FanboxArticleBody {
}
}
impl CheckUnkown for FanboxArticleBody {
fn check_unknown(&self) -> Result<(), FanboxAPIError> {
check_json_keys!("blocks"+, "imageMap", "fileMap", "embedMap", "urlEmbedMap",);
match self.blocks() {
Some(blocks) => {
for i in blocks {
i.check_unknown()?;
}
}
None => {}
}
Ok(())
}
}
impl Debug for FanboxArticleBody {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("FanboxArticleBody")