Fix struct serialization names.

This commit is contained in:
Kavin 2022-10-23 19:03:39 +01:00
parent c1414e307f
commit 37f677e1dc
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD

View File

@ -3,25 +3,24 @@ use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
pub struct Sponsor {
pub hash: String,
#[serde(rename = "video_id")]
#[serde(rename = "videoID")]
pub video_id: String,
pub segments: Vec<Segment>,
}
#[derive(Serialize, Deserialize)]
pub struct Segment {
#[serde(rename = "uuid")]
#[serde(rename = "UUID")]
pub uuid: String,
#[serde(rename = "action_type")]
#[serde(rename = "actionType")]
pub action_type: String,
pub category: String,
pub description: String,
pub locked: i32,
pub segment: Vec<f32>,
#[serde(rename = "user_id")]
#[serde(rename = "userID")]
pub user_id: String,
#[serde(rename = "video_duration")]
#[serde(rename = "videoDuration")]
pub video_duration: f32,
pub votes: i32,
}