Getting NPE when passing null to validate method.
rahul22048 opened this issue · 0 comments
rahul22048 commented
below is the code snippet:-
final JsonSchemaFactory factory = JsonSchemaFactory.byDefault();
final JsonNode node = JsonLoader.fromResource("/json-patch.json");
SCHEMA = factory.getJsonSchema(node);
in another method, i use it like this:-
ProcessingReport report = SCHEMA.validate(patchJson);
NPE exception comes when patchJson is passed as null.
for reference json-patch.json is same as the one here:- https://github.com/fge/json-schema-processor-examples/blob/master/src/main/resources/json-patch.json