develpoerX commented on a change in pull request #2014:
URL:
https://github.com/apache/servicecomb-java-chassis/pull/2014#discussion_r512452061
##########
File path:
service-registry/src/main/java/org/apache/servicecomb/serviceregistry/task/MicroserviceRegisterTask.java
##########
@@ -261,6 +263,21 @@ private boolean compareAndReRegisterSchema(Entry<String,
String> localSchemaEntr
String scSchemaContent = srClient.getSchema(microservice.getServiceId(),
scSchema.getSchemaId());
String localSchemaContent = localSchemaEntry.getValue();
+ if (isIllegalValue(scSchemaContent) &&
isIllegalValue(localSchemaContent)) {
+ Swagger scSwagger = SwaggerUtils.parseSwagger(scSchemaContent);
+ Swagger localSwagger = SwaggerUtils.parseSwagger(localSchemaContent);
+ if (scSwagger.equals(localSwagger)) {
+ if (ServiceRegistryConfig.INSTANCE.isIgnoreSwaggerDifferent()) {
+ LOGGER.warn(
+ "the local schema[{}]'s content is same with the service
center schema's content, but the order of some "
+ + " parameters in the configuration file is
inconsistent:\n service center schema:\n[{}]\n local schema:\n[{}]",
+ localSchemaEntry.getKey(),
+ scSchemaContent,
+ localSchemaContent);
+ }
+ return false;
Review comment:
done
##########
File path:
service-registry/src/main/java/org/apache/servicecomb/serviceregistry/task/MicroserviceRegisterTask.java
##########
@@ -261,6 +263,21 @@ private boolean compareAndReRegisterSchema(Entry<String,
String> localSchemaEntr
String scSchemaContent = srClient.getSchema(microservice.getServiceId(),
scSchema.getSchemaId());
String localSchemaContent = localSchemaEntry.getValue();
+ if (isIllegalValue(scSchemaContent) &&
isIllegalValue(localSchemaContent)) {
+ Swagger scSwagger = SwaggerUtils.parseSwagger(scSchemaContent);
+ Swagger localSwagger = SwaggerUtils.parseSwagger(localSchemaContent);
+ if (scSwagger.equals(localSwagger)) {
+ if (ServiceRegistryConfig.INSTANCE.isIgnoreSwaggerDifferent()) {
+ LOGGER.warn(
+ "the local schema[{}]'s content is same with the service
center schema's content, but the order of some "
+ + " parameters in the configuration file is
inconsistent:\n service center schema:\n[{}]\n local schema:\n[{}]",
+ localSchemaEntry.getKey(),
+ scSchemaContent,
+ localSchemaContent);
+ }
Review comment:
done
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]