0
votes

I have a few draft -03 json schema for some js objects.

And i am using z-schema https://github.com/zaggino/z-schema to validate the schema of js objects.

I am setting remote references with the help of its api setRemoteReference and providing the draft-03 schema object from here http://json-schema.org/draft-03/schema#

var ZSV = new ZSchemaValidator({ breakOnFirstError: false });
ZSV.setRemoteReference('http://json-schema.org/draft-03/schema#', {
  // json object downloaded from draft-03 url
});

But i call validate method it throws error

[{"code":"REMOTE_NOT_VALID","params":["http://json-schema.org/draft-03/schema#"],"message":"Remote reference didn't compile successfully: http://json-schema.org/draft-03/schema#","path":"#/uri(http://json-schema.org/draft-03/schema)","inner":  ....

Seems like the compilation failed. But how come the schema object downloaded from authentic source http://json-schema.org/draft-03/schema# can be wrong.?

Or is it that, z-schema not able to compile draft-03 effectively.?

So my question is, how can i validate draft-03 using z-schema?

1

1 Answers

0
votes

If the issue is using v3 schemas in a v4 tool, then you could try json-schema-compatibility.

It normalise schemas to v4 - v3 schemas are updated, v4 schemas are unchanged.

(Full disclosure: I wrote the tool)