From db6d5a537a4c8368a3b81ce3278a715d71063797 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 13 Mar 2024 22:34:26 +1000 Subject: [PATCH] ping to draft7 --- src/cli/types/schema.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cli/types/schema.rs b/src/cli/types/schema.rs index 3354513b..dc124567 100644 --- a/src/cli/types/schema.rs +++ b/src/cli/types/schema.rs @@ -1,4 +1,5 @@ use clap::{Args, ValueEnum}; +use schemars::gen::SchemaSettings; use crate::cli::Channel; @@ -38,9 +39,11 @@ macro_rules! run_x_case_for_type { if $type_name == stringify!($type) { match $output { OutputFormat::JsonSchemaDraft7 => { - let schema = schemars::schema_for!(crate::$m::$type); + let settings = SchemaSettings::draft07(); + let generator = settings.into_generator(); + let schema = generator.into_root_schema_for::(); println!("{}", serde_json::to_string_pretty(&schema)?); - }, + } } } };