diff --git a/packages/schema/src/schema_for.rs b/packages/schema/src/schema_for.rs index ab36df1c2..2e01426c6 100644 --- a/packages/schema/src/schema_for.rs +++ b/packages/schema/src/schema_for.rs @@ -24,19 +24,10 @@ macro_rules! schema_for { ) .into_root_schema_for::<$type>(); - struct Visitor; - impl $crate::schemars::visit::Visitor for Visitor { - fn visit_schema_object(&mut self, schema: &mut $crate::schemars::schema::SchemaObject) { - $crate::schemars::visit::visit_schema_object(self, schema); - - if let Some(ref mut validation) = schema.object { - validation.additional_properties = Some(Box::new(false.into())); - } - } + if let Some(ref mut validation) = schema.schema.object { + validation.additional_properties = Some(Box::new(false.into())); } - $crate::schemars::visit::visit_root_schema(&mut Visitor, &mut schema); - schema }}; ($_:expr) => {