Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jassi ignores "maxLength:0" contrary to specification. #5

Open
O11o1 opened this issue Jul 20, 2017 · 0 comments
Open

Jassi ignores "maxLength:0" contrary to specification. #5

O11o1 opened this issue Jul 20, 2017 · 0 comments

Comments

@O11o1
Copy link

O11o1 commented Jul 20, 2017

https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.1 states

5.2.1. maxLength

5.2.1.1. Valid values

The value of this keyword MUST be an integer. This integer MUST be
greater than, or equal to, 0.

Test case:

// Jassi ignores "maxLength:0"
let schema = {
      "oneOf":[
         {
            "type":"string",
            "format":"email",
            "minLength":1
         },
         {
            "type":"string",
            "maxLength":0
         }
      ]
   } ;

let schemaShort = {
   "type":"string",
   "maxLength":0
} ;

// Local test.
let errors = jassi ( "aaaaaa@hotmail.com" , schemaShort ) ;
console . log ( errors ) ;
let errors2 = jassi ( "aaaaaa@hotmail.com" , schema ) ; // Should be valid and is not.
console . log ( errors ) ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant