codelipenghui commented on code in PR #25193:
URL: https://github.com/apache/pulsar/pull/25193#discussion_r2848428466
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/AvroSchemaBasedCompatibilityCheck.java:
##########
@@ -51,11 +52,12 @@ public void checkCompatible(Iterable<SchemaData> from,
SchemaData to, SchemaComp
checkArgument(from != null, "check compatibility list is null");
try {
for (SchemaData schemaData : from) {
- Schema.Parser parser = new Schema.Parser();
+ Schema.Parser parser =
+ new
Schema.Parser(StructSchemaDataValidator.COMPATIBLE_NAME_VALIDATOR);
Review Comment:
Please also check the JsonSchemaCompatibilityCheck.java which still use
`Schema.Parser fromParser = new Schema.Parser();` in isAvroSchema check.
```
private boolean isAvroSchema(SchemaData schemaData) {
try {
Schema.Parser fromParser = new Schema.Parser();
fromParser.setValidateDefaults(false);
Schema fromSchema = fromParser.parse(new
String(schemaData.getData(), UTF_8));
return true;
} catch (Exception e) {
return false;
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]