its probably a very simple thing that Im missing, but my json-schema-validator (networknt/json-schema-validator) doesnt validate the type of my items inside an array.
This Java-snippet should yield errors:
var schema = "{\n" +
" \"$schema\": \"http://json-schema.org/draft/2020-12/schema#\",\n" +
" \"type\": \"array\",\n" +
" \"items\": [\n" +
" {\n" +
" \"type\": \"integer\"\n" +
" }\n" +
" ]\n" +
"}";
var input = "[true,false,{},\"foo\"]";
var factory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V202012);
var jSchema = factory.getSchema(schema);
var errors = jSchema.validate(new ObjectMapper().readTree(input));
System.out.println("Errors: '"+errors.stream().map(ValidationMessage::getMessage).collect(joining(", ")) +"'");
but 'errors is empty. Over on www.jsonschemavalidator.net this is invalid as expected.
What obvious am I overlooking here ?
Thanks!