Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException with JsonSchemaFactory #510

Closed
nd417 opened this issue Feb 7, 2022 · 1 comment
Closed

NullPointerException with JsonSchemaFactory #510

nd417 opened this issue Feb 7, 2022 · 1 comment

Comments

@nd417
Copy link

nd417 commented Feb 7, 2022

ObjectMapper objectMapper = new ObjectMapper();
JsonSchemaFactory schemaFactory = JsonSchemaFactory.builder(JsonSchemaFactory.getInstance(VersionFlag.V201909)).objectMapper(objectMapper).build();

generic exception occured:{}
java.lang.NullPointerException: null
at com.networknt.schema.JsonSchemaFactory.findMetaSchemaForSchema(JsonSchemaFactory.java:283)
at com.networknt.schema.JsonSchemaFactory.createValidationContext(JsonSchemaFactory.java:278)
at com.networknt.schema.JsonSchemaFactory.newJsonSchema(JsonSchemaFactory.java:272)
at com.networknt.schema.JsonSchemaFactory.getSchema(JsonSchemaFactory.java:316)
at com.networknt.schema.JsonSchemaFactory.getSchema(JsonSchemaFactory.java:324)

@stevehu
Copy link
Contributor

stevehu commented Feb 15, 2022

I couldn't reproduce it. Added a test case and you can try it yourself. Thanks.

https://github.com/networknt/json-schema-validator/blob/master/src/test/java/com/networknt/schema/Issue510Test.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants