Skip to content

Commit 431fc71

Browse files
author
Jakub Jankowski
authored
fix: top level array validations (#238)
* fix: top level array validations * fix: check empty object
1 parent 71c60cb commit 431fc71

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/SchemaRow/TopLevelSchemaRow.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export const TopLevelSchemaRow = ({
9393
}
9494

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

106106
{!isEmpty(validations) && (
107107
<Box fontSize="sm" mb={1} mt={-2}>
108-
<Validations validations={isRegularNode(schemaNode) ? getValidationsFromSchema(schemaNode) : {}} />
108+
<Validations validations={validations} />
109109
</Box>
110110
)}
111111

0 commit comments

Comments
 (0)