Add Schema methods insert, get and remove

These are just convenience methods that delegate to the inner object. `insert` will also convert bool schemas to object schemas.
This commit is contained in:
Graham Esau 2024-08-30 11:40:29 +01:00
parent d6c8b6b022
commit 0672c862c8
7 changed files with 109 additions and 76 deletions

View file

@ -25,9 +25,7 @@ pub enum MyEnum {
}
fn remove_format(schema: &mut Schema) {
if let Some(obj) = schema.as_object_mut() {
obj.remove("format");
}
schema.remove("format");
}
fn main() {