From afa30b56b44f9ac4bba265633da220555dddf467 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 2 Feb 2024 19:39:56 +0100 Subject: [PATCH] fix schema for SendPropIdentifier --- schema.json | 4 +--- src/demo/sendprop.rs | 12 +++++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/schema.json b/schema.json index f55b02e..fa65a80 100644 --- a/schema.json +++ b/schema.json @@ -12817,9 +12817,7 @@ "minimum": 0.0 }, "SendPropIdentifier": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 + "type": "string" }, "SendPropName": { "type": "string" diff --git a/src/demo/sendprop.rs b/src/demo/sendprop.rs index d1463e4..0a7cdfc 100644 --- a/src/demo/sendprop.rs +++ b/src/demo/sendprop.rs @@ -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 { + ::json_schema(gen) + } +} + #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] #[derive(Clone, Display, PartialEq, Serialize, Deserialize)] #[display("{index} = {value}")]