Greetings -
I'm using the 2.X version of the library, and I've noticed that the new exception in SchemaRegistry#validateSchemaNodeType (and probably #validateSchemaNodeNotNull too) from #1174 / #1250 backported in 2.0.2 don't appear to be honoring the SchemaRegistryConfig settings I have in place for error location formatting.
My SchemaRegistryConfig is created like this, and is configured to use PathType.JSON_PATH for error locations:
private static final SchemaRegistryConfig SCHEMA_REGISTRY_CONFIG = SchemaRegistryConfig.builder()
.pathType(PathType.JSON_PATH)
.errorMessageKeyword("message")
.cacheRefs(false)
.formatAssertionsEnabled(true)
.failFast(false)
.preloadSchema(false)
.typeLoose(false)
.build();
If I feed in an intentionally invalid schema and validate it against the specification or dialect schema to check syntax and structure, I receive an error location like $.properties.required in my test case. But when I try and construct the invalid schema itself through the SchemaRegistry, I trigger the new SchemaException with a message of Schema at #/properties/required must be object or boolean but was ARRAY where the location of the same field is reported as #/properties/required instead. It seems to be using the default of PathType.JSON_POINTER.
Is this the expected behavior?
This new exception is also just using the string message instead of the Error object like other SchemaException instances with an error location I was already catching and handling. That's not a big deal and I've fixed that assumption in my code to fall back to the message if needed, but I was expecting the errors to have consistent formatting when referring to invalid elements in the schema across the various operations and methods.
Greetings -
I'm using the
2.Xversion of the library, and I've noticed that the new exception inSchemaRegistry#validateSchemaNodeType(and probably#validateSchemaNodeNotNulltoo) from #1174 / #1250 backported in2.0.2don't appear to be honoring theSchemaRegistryConfigsettings I have in place for error location formatting.My
SchemaRegistryConfigis created like this, and is configured to usePathType.JSON_PATHfor error locations:If I feed in an intentionally invalid schema and validate it against the specification or dialect schema to check syntax and structure, I receive an error location like
$.properties.requiredin my test case. But when I try and construct the invalid schema itself through theSchemaRegistry, I trigger the newSchemaExceptionwith a message ofSchema at #/properties/required must be object or boolean but was ARRAYwhere the location of the same field is reported as#/properties/requiredinstead. It seems to be using the default ofPathType.JSON_POINTER.Is this the expected behavior?
This new exception is also just using the string
messageinstead of theErrorobject like otherSchemaExceptioninstances with an error location I was already catching and handling. That's not a big deal and I've fixed that assumption in my code to fall back to themessageif needed, but I was expecting the errors to have consistent formatting when referring to invalid elements in the schema across the various operations and methods.