Export to GitHub

jsonschema - issue #7

minLength and maxLength are not working.


Posted on Dec 4, 2008 by Happy Kangaroo

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. :)

Comment #1

Posted on Apr 16, 2009 by Swift Panda

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.

Comment #2

Posted on Apr 16, 2009 by Massive Bird

I dont remember what it was now... but I think the old code had "value.maxLength" somewhere

Status: New

Labels:
Type-Defect Priority-Medium