Skip to content

Commit

Permalink
Revert "Use visitor"
Browse files Browse the repository at this point in the history
This reverts commit e470075.

See: CosmWasm#2309
  • Loading branch information
snoyberg committed Dec 10, 2024
1 parent e17ecc4 commit e0aa92a
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions packages/schema/src/schema_for.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit e0aa92a

Please sign in to comment.