Date validation?

11 views
Skip to first unread message

sk

unread,
Jun 17, 2010, 2:43:09 PM6/17/10
to JSON Schema
Is JSONSchema not supposed to validate Dates? I realize there is not
native Date type in Json and this is maybe the explanation.

But, for example, if you specify a type "date" and then pass in a
valid js date, it fails saying "object found but date expected".

Thanks.

Tatu Saloranta

unread,
Jun 17, 2010, 5:46:35 PM6/17/10
to json-...@googlegroups.com

As far as I have seen, there isn't such thing as standard, or more
generally even valid javascript Date.
Different engines (browsers) seemed to have different set of input
formats they accept.
And even helper libraries seem pretty weak in this area, mostly
focusing on user input side, as opposed to using standardized date
formats.

This is not to say that json schema should not support, something like
subset of ISO-8601 Dates.
Just that there isn't much in json/js space to build from.

-+ Tatu +-

Reply all
Reply to author
Forward
0 new messages