Skip to content

Commit

Permalink
fix: top level array validations (#238)
Browse files Browse the repository at this point in the history
* fix: top level array validations

* fix: check empty object
  • Loading branch information
Jakub Jankowski authored Sep 26, 2023
1 parent 71c60cb commit 431fc71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/SchemaRow/TopLevelSchemaRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const TopLevelSchemaRow = ({
}

if (isComplexArray(schemaNode) && isPureObjectNode(schemaNode.children[0])) {
const validations = getValidationsFromSchema(schemaNode);
const validations = isRegularNode(schemaNode) ? getValidationsFromSchema(schemaNode) : {};
return (
<>
<ScrollCheck />
Expand All @@ -105,7 +105,7 @@ export const TopLevelSchemaRow = ({

{!isEmpty(validations) && (
<Box fontSize="sm" mb={1} mt={-2}>
<Validations validations={isRegularNode(schemaNode) ? getValidationsFromSchema(schemaNode) : {}} />
<Validations validations={validations} />
</Box>
)}

Expand Down

0 comments on commit 431fc71

Please sign in to comment.