garycourt / JSV

A JavaScript implementation of an extendable, fully compliant JSON Schema validator.
618 stars 84 forks source link

validation passes for incorrect "date-time" formatted value #85

Closed fredleefarr closed 10 years ago

fredleefarr commented 10 years ago

This appears to be valid, even though the date-time is wrong:

var json = { "dateModified" : "blah"};
var schema = {
                "name":"Summary",
                "properties":{
                    "dateModified":{
                        "type":"string",
                        "format" : "date-time",
                        "description":"Date the event was last modified",
                        "required":true
                    }

                }
};

var result = env.validate(json, schema);

Is "date-time" format validated?

Thanks!

garycourt commented 10 years ago

No, the "format" attribute is not used in validation.