Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/utils/renderSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,12 @@ export const renderSchema: Walker = function*(schema, level = 0, meta = { path:
...meta,
...(parsedSchema.items !== undefined &&
!Array.isArray(parsedSchema.items) && {
subtype: '$ref' in parsedSchema.items ? `$ref( ${parsedSchema.items.$ref} )` : parsedSchema.items.type,
subtype:
'$ref' in parsedSchema.items
? `$ref( ${parsedSchema.items.$ref} )`
: parsedSchema.items.type ||
(parsedSchema.items.properties && 'object') ||
Copy link
Contributor

@P0lip P0lip Jul 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(parsedSchema.items.properties && 'object')
The RHS will always be truthy.

EDIT:
just realized you want to have object returned here, so it's okay.

(parsedSchema.items.items && 'array'),
}),
path,
},
Expand Down