Ajv: Integer validation error

Created on 15 May 2017  路  2Comments  路  Source: ajv-validator/ajv

I use [email protected].

Ajv options object

{}

JSON Schema

{
  "type": "integer",
  "minimum": 0
}

Sample data

"abc"

In node REPL:

> const Ajv = require('ajv');
undefined
> const validator = (new Ajv({})).compile({type: 'integer', minimum: 0});
undefined
> validator(1);
true
> validator('1');
true
> validator('abc');
true

What results did you expect?
Expect to validate integer.

bug

Most helpful comment

fixed in 5.1.1

All 2 comments

@Niklv thanks for reporting.
That's the consequence of #485.
Version 5.0.1 is ok

fixed in 5.1.1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gpietro picture gpietro  路  4Comments

radio-miskovice picture radio-miskovice  路  6Comments

GabDug picture GabDug  路  5Comments

jabberwo picture jabberwo  路  7Comments

darrin picture darrin  路  5Comments