-
Notifications
You must be signed in to change notification settings - Fork 340
NullPointerException in regex pattern validation if no SchemaValidatorsConfig is passed #280
Copy link
Copy link
Closed
Labels
Description
It is possible to load a schema without a SchemaValidatorsConfig but in this case the validation of the schema itself will fail at regex pattern validation.
Location of the exception:
compileRegexPattern(pattern, validationContext.getConfig().isEcma262Validator());
public PatternValidator(String schemaPath, JsonNode schemaNode, JsonSchema parentSchema, ValidationContext validationContext) {
super(schemaPath, schemaNode, parentSchema, ValidatorTypeCode.PATTERN, validationContext);
pattern = "";
if (schemaNode != null && schemaNode.isTextual()) {
pattern = schemaNode.textValue();
try {
compileRegexPattern(pattern, validationContext.getConfig().isEcma262Validator());
} catch (PatternSyntaxException pse) {
logger.error("Failed to compile pattern : Invalid syntax [" + pattern + "]", pse);
throw pse;
} catch (SyntaxException se) {
logger.error("Failed to compile pattern : Invalid syntax [" + pattern + "]", se);
throw se;
}
}
Reactions are currently unavailable