1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use crate::SchemaExample;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use serde_json::{json, Value};
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
#[schemars(example = "Self::example")]
pub struct ItemCount {
pub count: u32,
pub value: Value,
}
impl ItemCount {
pub fn new() -> Self {
Self::default()
}
}
impl SchemaExample for ItemCount {
fn example() -> Self {
Self {
count: 60,
value: json!("Tundra"),
}
}
}