geraintluff / tv4

Tiny Validator for JSON Schema v4
http://geraintluff.github.io/tv4/
Other
1.17k stars 184 forks source link

Missing references should not return true, IMO. #185

Open sprugman opened 9 years ago

sprugman commented 9 years ago

I just noticed that this was by design, based on the tv4.missing demo. Is that in the spec? It seems backwards to me -- I want missing reference definitions to fail. Is it possible to make that an option? Do you know of another (good), browser compatible validator library that works that way?

TIA.

ramiel commented 9 years ago

This is a problem for me too. And if the reference do not contains a full uri (which is permitted in the spec) the external reference doesn't appear using getMissingUris so I cannot neither know an external reference is missing.

geraintluff commented 9 years ago

Nice suggestion making it an option - I'll work on that.

sanear commented 9 years ago

+1 for this - any kind of silent failure in a validator is a bad idea... the default assumption has to be that the schema is invalid unless proven otherwise; an invalid reference certainly doesn't suggest that everything is fine.