Hello,
On Mon, Jun 2, 2014 at 4:59 PM, makefile <
gwal...@gmail.com> wrote:
> I read something about the validator defaulting to draft v4 for schema
> validation. Is this true? If so, can I set it to work with draft v3?
>
This is true. In order to work with draft v3 you can do one of two things:
* set the $schema appropriately in your schema(s) since the library
detects that;
* configure the JsonSchemaFactory so that the default version used is draft v3.
For the latter, you need to customize your validation configuration:
final ValidationConfiguration cfg = ValidationConfiguration.newBuilder()
.setDefaultVersion(SchemaVersion.DRAFT_V3).freeze();
final JsonSchemaFactory factory = JsonSchemaFactory.newBuilder()
.setValidationConfiguration(cfg).freeze();
However, defining $schema is preferred; this is a better choice for
interoperability purposes.
Hopes this helps,
--
Francis Galiegue,
fgal...@gmail.com,
https://github.com/fge
JSON Schema in Java:
http://json-schema-validator.herokuapp.com
Parsers in pure Java:
https://github.com/parboiled1/grappa (redde
Caesaris:
https://github.com/sirthias)