This is an automated email from the ASF dual-hosted git repository. kriskras99 pushed a commit to branch feat/generic_datum_writer in repository https://gitbox.apache.org/repos/asf/avro-rs.git
commit f4f3fa552d21c2575a6504b6351735aa385b6cbf Author: default <[email protected]> AuthorDate: Wed Mar 4 09:41:32 2026 +0000 fix: `Value::validate_schemata` should not set `enclosing_namespace` `enclosing_namespace` is the namespace of the parent schema, but there is no parent schema and should therefore not be set. --- avro/src/types.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/avro/src/types.rs b/avro/src/types.rs index 90ea2b0..b6f658c 100644 --- a/avro/src/types.rs +++ b/avro/src/types.rs @@ -380,10 +380,8 @@ impl Value { let rs = ResolvedSchema::try_from(schemata.clone()) .expect("Schemata didn't successfully resolve"); let schemata_len = schemata.len(); - schemata.iter().any(|schema| { - let enclosing_namespace = schema.namespace(); - - match self.validate_internal(schema, rs.get_names(), enclosing_namespace) { + schemata.iter().any( + |schema| match self.validate_internal(schema, rs.get_names(), None) { Some(reason) => { let log_message = format!("Invalid value: {self:?} for schema: {schema:?}. Reason: {reason}"); @@ -395,8 +393,8 @@ impl Value { false } None => true, - } - }) + }, + ) } fn accumulate(accumulator: Option<String>, other: Option<String>) -> Option<String> {
