Skip to content

Getting NPE when passing null to validate method. #376

@rahul22048

Description

@rahul22048

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @rahul22048

        Issue actions

          Getting NPE when passing null to validate method. · Issue #376 · java-json-tools/json-schema-validator