@@ -45,20 +45,24 @@ const getPydanticFormField = (
45
45
requiredFields : string [ ] ,
46
46
formLabels ?: Record < string , string > ,
47
47
fieldDetailProvider ?: PydanticFormsContextConfig [ 'fieldDetailProvider' ] ,
48
+ isArrayItem : boolean = false , // Arrayitems should not have titles or descriptions. Their properties will have them instead
48
49
) => {
49
50
const options = getFieldOptions ( propertySchema ) ;
50
51
const fieldOptionsEntry = getFieldAllOfAnyOfEntry ( propertySchema ) ;
51
52
52
53
const pydanticFormField : PydanticFormField = {
53
54
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
+ : '' ,
62
66
arrayItem : propertySchema . items
63
67
? getPydanticFormField (
64
68
propertySchema . items ,
@@ -121,6 +125,7 @@ const parseProperties = (
121
125
formLabels ,
122
126
fieldDetailProvider ,
123
127
) ;
128
+
124
129
if ( propertySchema . type === PydanticFormFieldType . ARRAY ) {
125
130
// When the property is an array, we need to parse the item that is an array element
126
131
// Currently we only support arrays of single field types so items can never be multiple items
@@ -135,6 +140,7 @@ const parseProperties = (
135
140
requiredFields ,
136
141
formLabels ,
137
142
fieldDetailProvider ,
143
+ true ,
138
144
) ;
139
145
}
140
146
0 commit comments