File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
packages/react-openapi/src Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -233,7 +233,8 @@ function getSchemaProperties(schema: OpenAPIV3.SchemaObject): null | OpenAPISche
233233 } , [ ] as OpenAPISchemaPropertyEntry [ ] ) ;
234234 }
235235
236- if ( schema . type === 'array' ) {
236+ // check array AND schema.items as this is sometimes null despite what the type indicates
237+ if ( schema . type === 'array' && ! ! schema . items ) {
237238 const items = noReference ( schema . items ) ;
238239 const itemProperties = getSchemaProperties ( items ) ;
239240 if ( itemProperties ) {
@@ -352,7 +353,8 @@ function getSchemaTitle(
352353
353354 if ( schema . enum ) {
354355 type = 'enum' ;
355- } else if ( schema . type === 'array' ) {
356+ // check array AND schema.items as this is sometimes null despite what the type indicates
357+ } else if ( schema . type === 'array' && ! ! schema . items ) {
356358 type = `array of ${ getSchemaTitle ( noReference ( schema . items ) ) } ` ;
357359 } else if ( schema . type || schema . properties ) {
358360 type = schema . type ?? 'object' ;
You can’t perform that action at this time.
0 commit comments