@@ -45,20 +45,24 @@ const getPydanticFormField = (
4545 requiredFields : string [ ] ,
4646 formLabels ?: Record < string , string > ,
4747 fieldDetailProvider ?: PydanticFormsContextConfig [ 'fieldDetailProvider' ] ,
48+ isArrayItem : boolean = false , // Arrayitems should not have titles or descriptions. Their properties will have them instead
4849) => {
4950 const options = getFieldOptions ( propertySchema ) ;
5051 const fieldOptionsEntry = getFieldAllOfAnyOfEntry ( propertySchema ) ;
5152
5253 const pydanticFormField : PydanticFormField = {
5354 id,
54- title :
55- translateLabel ( propertyId , propertySchema . title , formLabels ) ||
56- propertyId ,
57- description : translateLabel (
58- `${ propertyId } _info` ,
59- propertySchema . description ,
60- formLabels ,
61- ) ,
55+ title : ! isArrayItem
56+ ? translateLabel ( propertyId , propertySchema . title , formLabels ) ||
57+ propertyId
58+ : '' ,
59+ description : ! isArrayItem
60+ ? translateLabel (
61+ `${ propertyId } _info` ,
62+ propertySchema . description ,
63+ formLabels ,
64+ )
65+ : '' ,
6266 arrayItem : propertySchema . items
6367 ? getPydanticFormField (
6468 propertySchema . items ,
@@ -121,6 +125,7 @@ const parseProperties = (
121125 formLabels ,
122126 fieldDetailProvider ,
123127 ) ;
128+
124129 if ( propertySchema . type === PydanticFormFieldType . ARRAY ) {
125130 // When the property is an array, we need to parse the item that is an array element
126131 // Currently we only support arrays of single field types so items can never be multiple items
@@ -135,6 +140,7 @@ const parseProperties = (
135140 requiredFields ,
136141 formLabels ,
137142 fieldDetailProvider ,
143+ true ,
138144 ) ;
139145 }
140146
0 commit comments