From b68927a5338c39f4c6a91e69cfe7f812ea149e00 Mon Sep 17 00:00:00 2001 From: Nick Randall Date: Wed, 16 Dec 2020 09:55:21 -0700 Subject: [PATCH] Add user-friendly message for maxLength validation "should not have fewer than 5 items" feels weird for a string of characters. I think we should revert back to v6 terminology and say "characters" instead of "items". --- lib/vocabularies/validation/limitLength.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vocabularies/validation/limitLength.ts b/lib/vocabularies/validation/limitLength.ts index 4d4a25ff0..61eff2cfe 100644 --- a/lib/vocabularies/validation/limitLength.ts +++ b/lib/vocabularies/validation/limitLength.ts @@ -6,7 +6,7 @@ import ucs2length from "../../compile/ucs2length" const error: KeywordErrorDefinition = { message({keyword, schemaCode}) { const comp = keyword === "maxLength" ? "more" : "fewer" - return str`should NOT have ${comp} than ${schemaCode} items` + return str`should NOT have ${comp} than ${schemaCode} characters` }, params: ({schemaCode}) => _`{limit: ${schemaCode}}`, }