@@ -60,6 +60,7 @@ impl TryInto<ValueType> for &ValueTypeBuilder {
6060pub ( super ) struct StructSchemaBuilder {
6161 fields : Vec < FieldSchema < ValueTypeBuilder > > ,
6262 field_name_idx : HashMap < FieldName , u32 > ,
63+ description : Option < Arc < str > > ,
6364}
6465
6566impl StructSchemaBuilder {
@@ -91,6 +92,7 @@ impl TryFrom<&StructSchema> for StructSchemaBuilder {
9192 let mut result = StructSchemaBuilder {
9293 fields : Vec :: with_capacity ( schema. fields . len ( ) ) ,
9394 field_name_idx : HashMap :: with_capacity ( schema. fields . len ( ) ) ,
95+ description : schema. description . clone ( ) ,
9496 } ;
9597 for field in schema. fields . iter ( ) {
9698 result. add_field ( FieldSchema :: < ValueTypeBuilder > :: from_alternative ( field) ?) ?;
@@ -110,6 +112,7 @@ impl TryInto<StructSchema> for &StructSchemaBuilder {
110112 . map ( FieldSchema :: < ValueType > :: from_alternative)
111113 . collect :: < Result < Vec < _ > > > ( ) ?,
112114 ) ,
115+ description : self . description . clone ( ) ,
113116 } )
114117 }
115118}
@@ -284,6 +287,10 @@ fn try_make_common_struct_schemas(
284287 }
285288 Ok ( StructSchema {
286289 fields : Arc :: new ( result_fields) ,
290+ description : schema1
291+ . description
292+ . clone ( )
293+ . or_else ( || schema2. description . clone ( ) ) ,
287294 } )
288295}
289296
@@ -484,6 +491,7 @@ fn analyze_struct_mapping(
484491 } ,
485492 StructSchema {
486493 fields : Arc :: new ( field_schemas) ,
494+ description : None ,
487495 } ,
488496 ) )
489497}
@@ -829,6 +837,7 @@ impl AnalyzerContext<'_> {
829837 } else {
830838 ValueType :: Struct ( StructSchema {
831839 fields : Arc :: from ( key_fields_schema. clone ( ) ) ,
840+ description : None ,
832841 } )
833842 } ;
834843 let mut value_fields_schema: Vec < FieldSchema > = vec ! [ ] ;
0 commit comments