@@ -45,44 +45,17 @@ const getArrayTypeDescription = (items, schemas) => {
4545 return 'array'
4646 }
4747
48- // Handle basic types
49- const itemType = items . type || items . schema ?. type
50- if ( itemType ) {
51- switch ( itemType ) {
52- case 'string' :
53- return 'array of strings'
54- case 'number' :
55- return 'array of numbers'
56- case 'integer' :
57- return 'array of integers'
58- case 'boolean' :
59- return 'array of booleans'
60- case 'null' :
61- return 'array of null values'
62- default :
63- return 'array'
64- }
65- }
66-
67- // Handle case where items is just a type string (fallback)
68- if ( typeof items === 'string' ) {
69- switch ( items ) {
70- case 'string' :
71- return 'array of strings'
72- case 'number' :
73- return 'array of numbers'
74- case 'integer' :
75- return 'array of integers'
76- case 'boolean' :
77- return 'array of booleans'
78- case 'null' :
79- return 'array of null values'
80- default :
81- return 'array'
82- }
48+ // Handle basic types with lookup table
49+ const typeLabels : Record < string , string > = {
50+ string : 'array of strings' ,
51+ number : 'array of numbers' ,
52+ integer : 'array of integers' ,
53+ boolean : 'array of booleans' ,
54+ null : 'array of null values' ,
8355 }
8456
85- return 'array'
57+ const type = typeof items === 'string' ? items : items . type || items . schema ?. type
58+ return typeLabels [ type ] || 'array'
8659}
8760
8861const renderSchema = (
@@ -121,7 +94,7 @@ const renderSchema = (
12194 showRequired = { showRequired }
12295 />
12396 < div className = "padding-bottom--md" >
124- < CollapseBox isInitCollapsed = { isExpandedByDefault } >
97+ < CollapseBox isInitExpanded = { isExpandedByDefault } >
12598 < >
12699 { Object . entries ( item . properties ) . map ( ( [ key , value ] : [ string , SchemaPropertyType ] ) => (
127100 < div key = { key } className = { styles . paramItemWrapper } >
@@ -207,7 +180,7 @@ const renderSchema = (
207180 />
208181 { shouldShowDetails && (
209182 < div className = "padding-bottom--md" >
210- < CollapseBox isInitCollapsed = { isExpandedByDefault } >
183+ < CollapseBox isInitExpanded = { isExpandedByDefault } >
211184 { ( ( ) => {
212185 // Check if array items are objects - if so, render properties directly (flatter structure)
213186 if ( arrayType === 'array of objects' ) {
@@ -258,7 +231,7 @@ const renderSchema = (
258231 showRequired = { showRequired }
259232 />
260233 < div className = "padding-bottom--md" >
261- < CollapseBox isInitCollapsed = { false } >
234+ < CollapseBox isInitExpanded = { false } >
262235 { item [ type ] . map ( ( option , index ) => (
263236 < div key = { `${ index } ` } className = { styles . paramItemWrapper } >
264237 { renderSchema ( option , schemas , option . title , showRequired , isExpandedByDefault ) }
0 commit comments