You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/12/14 03:20:15 UTC

[GitHub] [servicecomb-java-chassis] wujimin commented on issue #2130: java.lang.IllegalStateException: not allow complex type for query parameter, type=java.util.List.

wujimin commented on issue #2130:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2130#issuecomment-744140250


   `List<String>`这种是合法的  
   但是`List<User>`这种复杂类型是不可以的,没办法编码,并且这些复杂类型在url上传输,可能还涉及敏感信息泄漏的问题    
     
   如果服务自行评估,不存在信息泄漏,可以尝试使用2.1.3版本中新增加的query参数json编解码功能  
   (增加这个功能仅仅为了兼容某些系统的陈旧接口,没有特殊情况,不建议使用)  
   ```java
     @GetMapping("queryArrJSON")
     public String queryArrJSON(@ApiParam(collectionFormat = "json") @RequestParam("queryArr") String[] queryArr) {
       return Arrays.toString(queryArr) + queryArr.length;
     }
   ```  
   https://github.com/apache/servicecomb-java-chassis/blob/master/integration-tests/it-producer/src/main/java/org/apache/servicecomb/it/schema/DataTypeSpringmvcSchema.java  
     
   如果还需要其他query codec,可以自行实现自己的QueryCodec 


----------------------------------------------------------------
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:
users@infra.apache.org