Skip to content

Commit

Permalink
Docs reference: Fix bug with hidden array item properties (#34946)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Reuter authored Feb 9, 2024
1 parent 70d1942 commit a146d8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docusaurus/src/components/SpecSchema.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ function isObjectArray(schema) {
}

function showCollapsible(schema) {
return (schema.type === "array" && schema.items && schema.items.type !== "object") || (schema.type === "object" && schema.properties) || showDescription(schema)
return (schema.type === "object" && schema.properties) || showDescription(schema)
}

function showDescription(schema) {
return typeof schema.default !== "undefined" || schema.pattern || schema.examples || schema.description || isOneOf(schema);
return typeof schema.default !== "undefined" || schema.pattern || schema.examples || schema.description || isOneOf(schema) || (schema.type === "array" && schema.items && schema.items.type === "object");
}

function getIndentStyle(depth) {
Expand Down

0 comments on commit a146d8b

Please sign in to comment.