diff --git a/avro/src/schema_equality.rs b/avro/src/schema_equality.rs index b884a0f3..1097594c 100644 --- a/avro/src/schema_equality.rs +++ b/avro/src/schema_equality.rs @@ -240,7 +240,7 @@ pub fn set_schemata_equality_comparator( pub(crate) fn compare_schemata(schema_one: &Schema, schema_two: &Schema) -> bool { SCHEMATA_COMPARATOR_ONCE .get_or_init(|| { - debug!("Going to use the default schemata equality comparator: SpecificationEq.",); + debug!("Going to use the default schemata equality comparator: StructFieldEq.",); Box::new(StructFieldEq { include_attributes: false, }) diff --git a/avro_derive/tests/derive.rs b/avro_derive/tests/derive.rs index 82c377b1..a85caa05 100644 --- a/avro_derive/tests/derive.rs +++ b/avro_derive/tests/derive.rs @@ -1389,6 +1389,9 @@ mod test_derive { #[avro(default = r#""Foo""#)] myenum: MyEnum, + + #[avro(default = "null")] + optional: Option, } let schema = r#" @@ -1442,6 +1445,11 @@ mod test_derive { "symbols":["Foo", "Bar", "Baz"] }, "default":"Foo" + }, + { + "name":"optional", + "type": ["null", "string"], + "default": null } ] } @@ -1471,6 +1479,7 @@ mod test_derive { ), "c" => assert_eq!(None, field.default), "myenum" => assert_eq!(Some(json!("Foo")), field.default), + "optional" => assert_eq!(Some(json!(null)), field.default), _ => panic!("Unexpected field name"), } } @@ -1490,6 +1499,7 @@ mod test_derive { .collect(), array: vec![4, 5, 6], myenum: MyEnum::Bar, + optional: None, }); }