[GitHub] zhengyangyong commented on a change in pull request #729: [SCB-562] fix NPE when had empty interface (not have any method)

2018-05-30 Thread GitBox
zhengyangyong commented on a change in pull request #729: [SCB-562] fix NPE 
when had empty interface (not have any method)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/729#discussion_r191699334
 
 

 ##
 File path: 
core/src/main/java/org/apache/servicecomb/core/definition/SchemaMeta.java
 ##
 @@ -83,6 +83,12 @@ public String getPackageName() {
   }
 
   private void initOperations() {
+if (swagger.getPaths() == null) {
+  LOGGER.error(swagger.getInfo().getTitle() + " with path " + 
swagger.getBasePath()
 
 Review comment:
   Done


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #729: [SCB-562] fix NPE when had empty interface (not have any method)

2018-05-29 Thread GitBox
zhengyangyong commented on a change in pull request #729: [SCB-562] fix NPE 
when had empty interface (not have any method)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/729#discussion_r191341145
 
 

 ##
 File path: 
core/src/main/java/org/apache/servicecomb/core/definition/SchemaMeta.java
 ##
 @@ -83,6 +83,12 @@ public String getPackageName() {
   }
 
   private void initOperations() {
+if (swagger.getPaths() == null) {
+  LOGGER.error(swagger.getInfo().getTitle() + " with path " + 
swagger.getBasePath()
 
 Review comment:
   so, we can process this issue two way :
   1. throw a ServiceCombException exception, not NPE
   2. Give a error log to let user know it is not an appropriate practice and 
fix as quick as possible, and let service go
   
   This issue come from user report, he want fill interface later, which is 
better


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #729: [SCB-562] fix NPE when had empty interface (not have any method)

2018-05-29 Thread GitBox
zhengyangyong commented on a change in pull request #729: [SCB-562] fix NPE 
when had empty interface (not have any method)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/729#discussion_r191341145
 
 

 ##
 File path: 
core/src/main/java/org/apache/servicecomb/core/definition/SchemaMeta.java
 ##
 @@ -83,6 +83,12 @@ public String getPackageName() {
   }
 
   private void initOperations() {
+if (swagger.getPaths() == null) {
+  LOGGER.error(swagger.getInfo().getTitle() + " with path " + 
swagger.getBasePath()
 
 Review comment:
   so, we can process this issue two way :
   1. throw a ServiceCombException exception, not NPE
   2. Give a error log to let user know it is not an appropriate practice and 
fix as quick as possible, and let service go
   
   This issue come from user report, he want fill interface later


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #729: [SCB-562] fix NPE when had empty interface (not have any method)

2018-05-29 Thread GitBox
zhengyangyong commented on a change in pull request #729: [SCB-562] fix NPE 
when had empty interface (not have any method)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/729#discussion_r191326909
 
 

 ##
 File path: 
core/src/main/java/org/apache/servicecomb/core/definition/SchemaMeta.java
 ##
 @@ -83,6 +83,12 @@ public String getPackageName() {
   }
 
   private void initOperations() {
+if (swagger.getPaths() == null) {
+  LOGGER.error(swagger.getInfo().getTitle() + " with path " + 
swagger.getBasePath()
 
 Review comment:
   Had considered as warn before, but may mark as error to let user know it is 
not an appropriate practice and fix as quick as possible ?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #729: [SCB-562] fix NPE when had empty interface (not have any method)

2018-05-28 Thread GitBox
zhengyangyong commented on a change in pull request #729: [SCB-562] fix NPE 
when had empty interface (not have any method)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/729#discussion_r191162200
 
 

 ##
 File path: 
core/src/main/java/org/apache/servicecomb/core/definition/SchemaMeta.java
 ##
 @@ -83,40 +83,42 @@ public String getPackageName() {
   }
 
   private void initOperations() {
-for (Entry entry : swagger.getPaths().entrySet()) {
-  String strPath = entry.getKey();
-  Path path = entry.getValue();
-  for (Entry operationEntry : 
path.getOperationMap().entrySet()) {
-Operation operation = operationEntry.getValue();
-if (operation.getOperationId() == null) {
-  throw ExceptionUtils.operationIdInvalid(getSchemaId(), strPath);
+if (swagger.getPaths() != null) {
 
 Review comment:
   emmm, ok , add an error output in order to notice user like
   `swagger definition for org.apache.servicecomb.samples.uselog4j2.HelloImpl 
with path /hello is an empty interface, please delete it or fill with one 
method!`


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #729: [SCB-562] fix NPE when had empty interface (not have any method)

2018-05-28 Thread GitBox
zhengyangyong commented on a change in pull request #729: [SCB-562] fix NPE 
when had empty interface (not have any method)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/729#discussion_r191151310
 
 

 ##
 File path: 
core/src/main/java/org/apache/servicecomb/core/definition/SchemaMeta.java
 ##
 @@ -83,40 +83,42 @@ public String getPackageName() {
   }
 
   private void initOperations() {
-for (Entry entry : swagger.getPaths().entrySet()) {
-  String strPath = entry.getKey();
-  Path path = entry.getValue();
-  for (Entry operationEntry : 
path.getOperationMap().entrySet()) {
-Operation operation = operationEntry.getValue();
-if (operation.getOperationId() == null) {
-  throw ExceptionUtils.operationIdInvalid(getSchemaId(), strPath);
+if (swagger.getPaths() != null) {
 
 Review comment:
   good idea, done


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #729: [SCB-562] fix NPE when had empty interface (not have any method)

2018-05-28 Thread GitBox
zhengyangyong commented on a change in pull request #729: [SCB-562] fix NPE 
when had empty interface (not have any method)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/729#discussion_r191133406
 
 

 ##
 File path: 
core/src/main/java/org/apache/servicecomb/core/definition/SchemaMeta.java
 ##
 @@ -83,40 +83,42 @@ public String getPackageName() {
   }
 
   private void initOperations() {
-for (Entry entry : swagger.getPaths().entrySet()) {
-  String strPath = entry.getKey();
-  Path path = entry.getValue();
-  for (Entry operationEntry : 
path.getOperationMap().entrySet()) {
-Operation operation = operationEntry.getValue();
-if (operation.getOperationId() == null) {
-  throw ExceptionUtils.operationIdInvalid(getSchemaId(), strPath);
+if (swagger.getPaths() != null) {
 
 Review comment:
   I think no necessary, user want fill this empty interface later, so it's not 
a **wrong scenario**


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #729: [SCB-562] fix NPE when had empty interface (not have any method)

2018-05-28 Thread GitBox
zhengyangyong commented on a change in pull request #729: [SCB-562] fix NPE 
when had empty interface (not have any method)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/729#discussion_r191133406
 
 

 ##
 File path: 
core/src/main/java/org/apache/servicecomb/core/definition/SchemaMeta.java
 ##
 @@ -83,40 +83,42 @@ public String getPackageName() {
   }
 
   private void initOperations() {
-for (Entry entry : swagger.getPaths().entrySet()) {
-  String strPath = entry.getKey();
-  Path path = entry.getValue();
-  for (Entry operationEntry : 
path.getOperationMap().entrySet()) {
-Operation operation = operationEntry.getValue();
-if (operation.getOperationId() == null) {
-  throw ExceptionUtils.operationIdInvalid(getSchemaId(), strPath);
+if (swagger.getPaths() != null) {
 
 Review comment:
   I think no necessary, user want fill this empty interface later, so it's not 
a `wrong scenario`


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services