liubao68 commented on a change in pull request #2014:
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/2014#discussion_r512442344



##########
File path: 
service-registry/src/main/java/org/apache/servicecomb/serviceregistry/task/MicroserviceRegisterTask.java
##########
@@ -261,6 +263,24 @@ private boolean compareAndReRegisterSchema(Entry<String, 
String> localSchemaEntr
       String scSchemaContent = srClient.getSchema(microservice.getServiceId(), 
scSchema.getSchemaId());
       String localSchemaContent = localSchemaEntry.getValue();
 
+      if (!StringUtils.isEmpty(scSchemaContent) && 
!StringUtils.isEmpty(localSchemaContent)) {
+        Swagger scSwagger = SwaggerUtils.parseSwagger(scSchemaContent);
+        Swagger localSwagger = SwaggerUtils.parseSwagger(localSchemaContent);
+        if (scSwagger.equals(localSwagger)) {
+          return true;
+        }
+        if (ServiceRegistryConfig.INSTANCE.isIgnoreSwaggerDifference()) {
+          LOGGER.warn(
+              "service center schema and local schema both are different:\n 
service center schema:\n[{}]\n local schema:\n[{}]"
+                  + "\nYou need to increment microservice version before 
deploying. "

Review comment:
       service center schema and local schema both are different:\n service 
center schema:\n[{}]\n local schema:\n[{}]"
                     + "\nYou have configured to ignore difference check. It's 
recommented  to increment microservice version before deploying when shcema 
change.




----------------------------------------------------------------
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]


Reply via email to