You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by kr...@apache.org on 2026/02/22 21:03:12 UTC
(avro-rs) 05/06: feat: Log warning if record field contains a logical type
This is an automated email from the ASF dual-hosted git repository.
kriskras99 pushed a commit to branch feat/enums
in repository https://gitbox.apache.org/repos/asf/avro-rs.git
commit f304f0a2bdabd298b9d483bf4397845cc4f0bbf7
Author: default <ad...@kriskras99.nl>
AuthorDate: Fri Feb 20 12:43:07 2026 +0000
feat: Log warning if record field contains a logical type
---
avro/src/schema/record/field.rs | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/avro/src/schema/record/field.rs b/avro/src/schema/record/field.rs
index a2a1df3..7c56b50 100644
--- a/avro/src/schema/record/field.rs
+++ b/avro/src/schema/record/field.rs
@@ -21,6 +21,7 @@ use crate::schema::{Documentation, Name, Names, Parser, Schema, SchemaKind};
use crate::types;
use crate::util::MapHelper;
use crate::validator::validate_record_field_name;
+use log::warn;
use serde::ser::SerializeMap;
use serde::{Serialize, Serializer};
use serde_json::{Map, Value};
@@ -82,6 +83,12 @@ impl RecordField {
let ty = field.get("type").ok_or(Details::GetRecordFieldTypeField)?;
let schema = parser.parse(ty, &enclosing_record.namespace)?;
+ if let Some(logical_type) = field.get("logicalType") {
+ warn!(
+ "Ignored the {enclosing_record}.logicalType property (`{logical_type}`). It should probably be nested instide the `type` for the field"
+ );
+ }
+
let default = field.get("default").cloned();
Self::resolve_default_value(
&schema,