1
0
Fork 0
mirror of https://codeberg.org/demostf/parser.git synced 2026-06-03 18:24:05 +02:00

fix schema for SendPropIdentifier

This commit is contained in:
Robin Appelman 2024-02-02 19:39:56 +01:00
commit d9ff9d4662
2 changed files with 12 additions and 4 deletions

View file

@ -1114,7 +1114,6 @@ impl<'a> TryFrom<&'a SendPropValue> for &'a [SendPropValue] {
}
}
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Debug, Clone, Copy, Ord, PartialOrd, Eq, PartialEq, Hash)]
pub struct SendPropIdentifier(u64);
@ -1199,6 +1198,17 @@ impl Serialize for SendPropIdentifier {
}
}
#[cfg(feature = "schema")]
impl schemars::JsonSchema for SendPropIdentifier {
fn schema_name() -> String {
"SendPropIdentifier".into()
}
fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
<String as schemars::JsonSchema>::json_schema(gen)
}
}
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Display, PartialEq, Serialize, Deserialize)]
#[display("{index} = {value}")]