@@ -26,7 +26,7 @@ const getArrayTypeDescription = (items, schemas) => {
2626
2727 // Handle object types
2828 if ( items . type === 'object' || items . schema ?. type === 'object' ) {
29- return 'array'
29+ return 'array of objects '
3030 }
3131
3232 // Handle combination types
@@ -166,6 +166,34 @@ const renderSchema = (
166166
167167 const shouldShowDetails = ! simpleArrayTypes . includes ( arrayType )
168168
169+ // Helper function to render object properties directly (flatter structure)
170+ const renderObjectProperties = objectSchema => {
171+ if ( ! objectSchema || ! objectSchema . properties ) return null
172+
173+ const requiredFields = Array . isArray ( objectSchema . required ) ? objectSchema . required : [ ]
174+
175+ return (
176+ < >
177+ { Object . entries ( objectSchema . properties ) . map (
178+ ( [ key , value ] : [ string , SchemaPropertyType ] ) => (
179+ < div key = { key } className = { styles . paramItemWrapper } >
180+ { renderSchema (
181+ {
182+ ...value ,
183+ required : requiredFields . includes ( key ) ,
184+ } ,
185+ schemas ,
186+ key ,
187+ showRequired ,
188+ isExpandedByDefault
189+ ) }
190+ </ div >
191+ )
192+ ) }
193+ </ >
194+ )
195+ }
196+
169197 return (
170198 < div >
171199 < SchemaProperty
@@ -180,9 +208,29 @@ const renderSchema = (
180208 { shouldShowDetails && (
181209 < div className = "padding-bottom--md" >
182210 < CollapseBox isInitCollapsed = { isExpandedByDefault } >
183- < div className = { styles . paramItemWrapper } >
184- { renderSchema ( item . items , schemas , '' , showRequired , isExpandedByDefault ) }
185- </ div >
211+ { ( ( ) => {
212+ // Check if array items are objects - if so, render properties directly (flatter structure)
213+ if ( arrayType === 'array of objects' ) {
214+ // Handle referenced objects
215+ if ( item . items ?. $ref ) {
216+ const refSchema = getRefSchemaFromComponents ( item . items . $ref , schemas )
217+ const objectProperties = renderObjectProperties ( refSchema )
218+ if ( objectProperties ) return objectProperties
219+ }
220+ // Handle inline objects
221+ else if ( item . items ?. type === 'object' && item . items . properties ) {
222+ const objectProperties = renderObjectProperties ( item . items )
223+ if ( objectProperties ) return objectProperties
224+ }
225+ }
226+
227+ // For all other array types, use the original rendering approach
228+ return (
229+ < div className = { styles . paramItemWrapper } >
230+ { renderSchema ( item . items , schemas , '' , showRequired , isExpandedByDefault ) }
231+ </ div >
232+ )
233+ } ) ( ) }
186234 </ CollapseBox >
187235 </ div >
188236 ) }
0 commit comments