Skip to content

Commit 2f81a08

Browse files
committed
fix maxItems validation error message
The message refers to the `minItems` value (incorrect), not the `maxItems` value (correct). This leads to incorrect validation error messages when using maxItems, such as in the example below (which can occur with `maxItems` is not 0): > Array has too many items. Expected 0 or fewer.
1 parent ef4538b commit 2f81a08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/parser/jsonParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ function validate(node: ASTNode, schema: JSONSchema, validationResult: Validatio
726726
validationResult.problems.push({
727727
location: { offset: node.offset, length: node.length },
728728
severity: DiagnosticSeverity.Warning,
729-
message: localize('maxItemsWarning', 'Array has too many items. Expected {0} or fewer.', schema.minItems)
729+
message: localize('maxItemsWarning', 'Array has too many items. Expected {0} or fewer.', schema.maxItems)
730730
});
731731
}
732732

0 commit comments

Comments
 (0)