We have been tracking some custom events. In one of our custom event we have a field of datatype date. So we have added “format” as date. Something like this
Now the above JSON should occur in validation error because date field having string. It does so in online schema validators. But over here it is not send to bad bucket and hence whole storage loader is failed while loading data into Redshift.
In JSON Schema v4 spec there’s no date format, only date-time. Also specification defines behavior for unknown formats - it just ignores it in case someone extended validator and added custom format.
date exists in JSON Schema v3 which we don’t use, but I guess some online validator that you tried used v3 or added date as one of their custom formats.
@jimy2004king, also we have tool called igluctl, which supposed to handle this kind of mistakes - but it doesn’t handle this particular mistake, I created a ticket to address this. But still you may want to use it to find other subtle errors in your schema.
jsonschemalint.com use different validators for different versions. AJV for v4 and JSV for v3.
JSV is slow and buggy. It validates your instance against v3 just because it seems that is doesn’t care about format at all: notice for example format: uri in this snippet.
AJV is very flexible and has lots of features, but those features don’t have much in common with specification which I linked before.
As I said this is very unfortunate coincidence, because we didn’t have such problems with online validators before (I think jsonschemalint.com changed its validator core very recently). We at Snowplow use this validator (previously known as fge’s) at enrichment, shredding and all other places. You can use its online version to be sure which JSONs will pass validation and which will not. However, I found important differences with online version and our apps: 1) it doesn’t understand self-describing JSON’s self property 2) it marks unknown formats as errors.
Once again, we didn’t have these problems before and used to rely on online validators, however it seems that we need to reconsider their usage. So, thanks for raising.