More lenient parsing

This commit is contained in:
Leonora Tindall 2022-11-01 14:15:28 -05:00
parent d39e19beb2
commit 55a2610eff
Signed by: nora
GPG Key ID: 7A8B52EC67E09AAF
1 changed files with 9 additions and 3 deletions

View File

@ -26,12 +26,13 @@ pub struct CohostPostsPage {
pub struct CohostPost {
#[serde(rename = "postId")]
pub id: u64,
#[serde(default)]
pub headline: String,
#[serde(rename = "publishedAt")]
pub published_at: DateTime<Utc>,
pub cws: Vec<String>,
pub tags: Vec<String>,
#[serde(rename = "plainTextBody")]
#[serde(rename = "plainTextBody", default)]
pub plain_body: String,
#[serde(rename = "singlePostPageUrl")]
pub url: String,
@ -46,18 +47,23 @@ pub struct CohostPostingProject {
#[serde(rename = "projectId")]
pub id: u64,
pub handle: String,
#[serde(rename = "displayName")]
#[serde(rename = "displayName", default)]
pub display_name: String,
#[serde(default)]
pub dek: String,
#[serde(default)]
pub description: String,
#[serde(default)]
pub pronouns: String,
}
#[derive(Deserialize)]
pub struct CohostPostLink {
#[serde(default)]
pub href: String,
#[serde(default)]
pub rel: String,
#[serde(rename = "type")]
#[serde(rename = "type", default)]
pub t_type: String,
}