bpdusk / jsonschema

Automatically exported from code.google.com/p/jsonschema
0 stars 0 forks source link

minLength and maxLength are not working. #7

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
near line 144 should be:

if (schema.maxLength && typeof value == 'string' && (value.length >
schema.maxLength))
    addError("may only be " + schema.maxLength + " characters long");
if (schema.minLength && typeof value == 'string' && (value.length <
schema.minLength))
    addError("must be at least " + schema.minLength + " characters long");

There were value.maxLength checks. But this does not exists. :)

Original issue reported on code.google.com by bruno.gradua@gmail.com on 4 Dec 2008 at 9:24

GoogleCodeExporter commented 8 years ago
I don't understand this issue. Are you saying there isn't any 
maxLength/minLength
check taking place? There should be in the latest version.

Original comment by kris...@gmail.com on 16 Apr 2009 at 8:38

GoogleCodeExporter commented 8 years ago
I dont remember what it was now... but I think the old code had 
"value.maxLength"
somewhere

Original comment by bruno.p.reis@gmail.com on 16 Apr 2009 at 8:59