[GitHub] WillemJiang 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
WillemJiang 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_r191320680
 
 

 ##
 File path: 
core/src/main/java/org/apache/servicecomb/core/definition/SchemaMeta.java
 ##
 @@ -84,6 +84,8 @@ public String getPackageName() {
 
   private void initOperations() {
 
 Review comment:
   It just does the check, maybe we can name it as checkOperations. 


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

 ##
 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:
   User cannot know what's wrong if we don't tell them. We should provide 
detail information if something is wrong.
   If he doesn't provide any operation here, and have some trouble to access 
the service, he will complain that there is no any clue for me to find the 
reason.  
   That is why we cannot swallow any exception when writing the code.


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

 ##
 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 we to write a logger for it, so use can know what's wrong here.


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