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/11/26 06:07:06 UTC

[GitHub] [servicecomb-java-chassis] HoyerIsAlexander opened a new issue #2081: servicecomb升级至2.1.2版本后,GET接口请求参数设置值方式修改

HoyerIsAlexander opened a new issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081


   我们接口定义的请求参数是List<String> ,然后传个空,接收下来是[null],servicecomb版本是2.1.2,之前使用的是1.3.0版本,接受为空数组[],请问这个是处于什么考虑,我们是否可以自定义


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



[GitHub] [servicecomb-java-chassis] wujimin commented on issue #2081: servicecomb升级至2.1.2版本后,GET接口请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
wujimin commented on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-735051562


   query如何传递,与是否使用@BeanParam没有任何联系  
   query的编码,按swagger 2.0的定义,有multi/csv/ssv等等几种方式,默认为multi  
   不知道你想要什么效果


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



[GitHub] [servicecomb-java-chassis] HoyerIsAlexander edited a comment on issue #2081: servicecomb升级至2.1.2版本后,接口List对象请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
HoyerIsAlexander edited a comment on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-747170110


   CSE版本:3.1.5 ServiceComb版本:2.1.2 Jackson版本:2.11.0
   
   业务代码:
   
   ```
   API接口
   
   public interface ApiInterface {
    QueryRsp query(@Valid QueryParam queryParam);
   }
   
   API实现类
   
   @RestSchema(schemaId = "apiImpl")
   @Path("")
   @Consumes({MediaType.APPLICATION_JSON, MediaType.TEXT_XML})
   @Produces({"application/json; charset=UTF-8", "text/xml; charset=UTF-8"})
   public class ApiImpl {
       @GET
       @Path("/query")
       @Override
       QueryRsp query(@BeanParam QueryParam queryParam) {
       //TODO
       }
   }
   
   QueryParam 
   
   @Data
   public class IncidentLogQueryParam{
       @QueryParam("params")
       private List<@NotNull Integer> params;
   }
   ```
   
   浏览器请求:
   
   `http://localhost:8080/query?params=`
   
   结果:
   
   `params:[null]`
   
   
   另外新增Post接口
   
   业务代码:
   `Param  private List<String> params`
   
   请求参数:
   `{
   params: ''
    }`
   
   结果:
   
   `params:[""]`
   
   


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



[GitHub] [servicecomb-java-chassis] HoyerIsAlexander edited a comment on issue #2081: servicecomb升级至2.1.2版本后,接口List对象请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
HoyerIsAlexander edited a comment on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-747170110


   CSE版本:3.1.5 ServiceComb版本:2.1.2 Jackson版本:2.11.0
   
   业务代码:
   
   ```
   API接口
   
   public interface ApiInterface {
    QueryRsp query(@Valid QueryParam queryParam);
   }
   
   API实现类
   
   @RestSchema(schemaId = "apiImpl")
   @Path("")
   @Consumes({MediaType.APPLICATION_JSON, MediaType.TEXT_XML})
   @Produces({"application/json; charset=UTF-8", "text/xml; charset=UTF-8"})
   public class ApiImpl {
       @GET
       @Path("/query")
       @Override
       QueryRsp query(@BeanParam QueryParam queryParam) {
       //TODO
       }
   }
   
   QueryParam 
   
   @Data
   public class QueryParam{
       @QueryParam("params")
       private List<@NotNull Integer> params;
   }
   ```
   
   浏览器请求:
   
   `http://localhost:8080/query?params=`
   
   结果:
   
   `params:[null]`
   
   
   另外新增Post接口
   
   业务代码:
   `Param  private List<String> params`
   
   请求参数:
   `{
   params: ''
    }`
   
   结果:
   
   `params:[""]`
   
   


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



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2081: servicecomb升级至2.1.2版本后,接口List对象请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-747153718


   你能发下你的代码是怎么写的吗?前面的讨论和例子,实际上都说明了你的用法不会返回 new String[]{null}。 我测试也没发现这种情况。 
   
   可以按照下面格式反馈下:
   
   业务代码:
   
   ```
     @Path("queryListCSV")
     @GET
     public String queryListCSV(@ApiParam(collectionFormat = "csv") @QueryParam("queryList") List<String> queryList) {
       return queryList == null ? "null" : queryList.size() + ":" + queryList.toString();
     }
   ```
   
   浏览器请求:
   
   ```
   http://localhost:8080/queryList/queryListCSV?queryList=
   ```
   
   预期结果:
   
   ```
   "1:[]"
   ```
   
   浏览器请求:
   
   ```
   http://localhost:8080/queryList/queryListCSV
   ```
   
   预期结果:
   
   ```
   "0:[]"
   ```


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



[GitHub] [servicecomb-java-chassis] wujimin commented on issue #2081: servicecomb升级至2.1.2版本后,接口List对象请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
wujimin commented on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-747809912


   不是BeanParam的问题,一个是`List<Integer>`,一个是`List<String>`  
   `List<String> strings = List.of("")`,对应的就是`List<Integer> ints = List.of(null)`


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



[GitHub] [servicecomb-java-chassis] HoyerIsAlexander edited a comment on issue #2081: servicecomb升级至2.1.2版本后,GET接口请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
HoyerIsAlexander edited a comment on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-747139925


   之前的1.3.0版本中,这么传值接受是空数组,现在传null包括传一个“”都会认为是new String[]{null}或者new String[]{""},包括Post接口,导致很多兼容性问题,虽然之前客户的用法不太正确,但是当时确实可以,然后引起了客户投诉,想了解下后续这方面的修改我们在版本升级的时候应该从哪里获取,另外我们是否可以自定义


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



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2081: servicecomb升级至2.1.2版本后,GET接口请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-734201884


   加了个测试用例: https://github.com/apache/servicecomb-java-chassis/pull/2086 , 看下是否符合你的场景。 


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



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2081: servicecomb升级至2.1.2版本后,GET接口请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-734162008


   query 为 List 的情况有多种编码形式, 你需要的是那种?
   
   ```
     @Path("queryArrCSV")
     @GET
     public String queryArrCSV(@ApiParam(collectionFormat = "csv") @QueryParam("queryArr") String[] queryArr) {
       return Arrays.toString(queryArr) + queryArr.length;
     }
   
     @Path("queryArrSSV")
     @GET
     public String queryArrSSV(@ApiParam(collectionFormat = "ssv") @QueryParam("queryArr") String[] queryArr) {
       return Arrays.toString(queryArr) + queryArr.length;
     }
   
     @Path("queryArrTSV")
     @GET
     public String queryArrTSV(@ApiParam(collectionFormat = "tsv") @QueryParam("queryArr") String[] queryArr) {
       return Arrays.toString(queryArr) + queryArr.length;
     }
   
     @Path("queryArrPIPES")
     @GET
     public String queryArrPIPES(@ApiParam(collectionFormat = "pipes") @QueryParam("queryArr") String[] queryArr) {
       return Arrays.toString(queryArr) + queryArr.length;
     }
   
     @Path("queryArrMULTI")
     @GET
     public String queryArrMULTI(@ApiParam(collectionFormat = "multi") @QueryParam("queryArr") String[] queryArr) {
       return Arrays.toString(queryArr) + queryArr.length;
     }
   ```
   


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



[GitHub] [servicecomb-java-chassis] HoyerIsAlexander edited a comment on issue #2081: servicecomb升级至2.1.2版本后,GET接口请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
HoyerIsAlexander edited a comment on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-747139925


   之前的1.3.0版本中,这么传值接受是空数组,现在传null包括传一个“”都会认为是new String[]{null}或者new String[]{""},包括Post接口,导致很多兼容性问题,引起了客户投诉,想了解下后续这方面的修改我们在版本升级的时候应该从哪里获取,另外我们是否可以自定义


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



[GitHub] [servicecomb-java-chassis] liubao68 edited a comment on issue #2081: servicecomb升级至2.1.2版本后,GET接口请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
liubao68 edited a comment on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-734186595


   补充问下, `我们接口定义的请求参数是List ,然后传个空,接收下来是[null]`, 这个你是怎么请求的? 我用最新代码测试了下, 结果是空数组。 下面的测试用例是可以通过的:
   
   ```
     @Path("queryListMULTI")
     @GET
     public String queryListMULTI(@ApiParam(collectionFormat = "multi") @QueryParam("queryList") List<String> queryList) {
       return queryList == null ? "null" : queryList.toString();
     }
   
   TestMgr.check("[]",
           restTemplate.getForObject("cse://jaxrs/queryList/queryListMULTI?queryList=", String.class));
   ```


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



[GitHub] [servicecomb-java-chassis] HoyerIsAlexander commented on issue #2081: servicecomb升级至2.1.2版本后,GET接口请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
HoyerIsAlexander commented on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-747139925


   之前的1.3.0版本中,这么传值接受是空数组,现在传null包括传一个“”都会认为是new String[]{null}或者new String[]{""},导致很多兼容性问题,引起了客户投诉,想了解下后续这方面的修改我们在版本升级的时候应该从哪里获取,另外我们是否可以只定义


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



[GitHub] [servicecomb-java-chassis] liubao68 edited a comment on issue #2081: servicecomb升级至2.1.2版本后,接口List对象请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
liubao68 edited a comment on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-747810659


   哦。 我还看错了。 `List<Integer>` 确实和 `List<String>` 不同。 


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



[GitHub] [servicecomb-java-chassis] HoyerIsAlexander edited a comment on issue #2081: servicecomb升级至2.1.2版本后,接口List对象请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
HoyerIsAlexander edited a comment on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-747170110


   CSE版本:3.1.5 ServiceComb版本:2.1.2 Jackson版本:2.11.0
   
   业务代码:
   
   `
   API接口
   
   public interface ApiInterface {
    QueryRsp query(@Valid QueryParam queryParam);
   }
   
   API实现类
   
   @RestSchema(schemaId = "apiImpl")
   @Path("")
   @Consumes({MediaType.APPLICATION_JSON, MediaType.TEXT_XML})
   @Produces({"application/json; charset=UTF-8", "text/xml; charset=UTF-8"})
   public class ApiImpl {
       @GET
       @Path("/query")
       @Override
       QueryRsp query(@BeanParam QueryParam queryParam) {
       //TODO
       }
   }
   
   QueryParam 
   
   @Data
   public class IncidentLogQueryParam{
       @QueryParam("params")
       private List<@NotNull Integer> params;
   }
   `
   
   浏览器请求:
   
   `http://localhost:8080/query?params=`
   
   结果:
   
   `params:[null]`
   
   
   另外新增Post接口
   
   业务代码:
   `Param  private List<String> params`
   
   请求参数:
   `{
   params: ''
    }`
   
   结果:
   
   `params:[""]`
   
   


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



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2081: servicecomb升级至2.1.2版本后,接口List对象请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-747808634


   BeanParam的GET场景, 返回 [null], 我觉得是 bug。 
   
   Post 场景你说的不兼容以前是返回什么,你的预期是返回什么? 你给的POST用法其实不是很正确。 List 传递参数的时候,应该是  {params: [] } , 这才是数组。 {params:''} 这个是传递 String 类型。 单个 String类型被解析为数组的时候, 为一个元素的数组,这个也是合理的。


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



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2081: servicecomb升级至2.1.2版本后,GET接口请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-734186595


   补充问下, `我们接口定义的请求参数是List ,然后传个空,接收下来是[null]`, 这个你是怎么请求的? 为用最新代码测试了下, 结果是空数组。 下面的测试用例是可以通过的:
   
   ```
     @Path("queryListMULTI")
     @GET
     public String queryListMULTI(@ApiParam(collectionFormat = "multi") @QueryParam("queryList") List<String> queryList) {
       return queryList == null ? "null" : queryList.toString();
     }
   
   TestMgr.check("[]",
           restTemplate.getForObject("cse://jaxrs/queryList/queryListMULTI?queryList=", String.class));
   ```


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



[GitHub] [servicecomb-java-chassis] HoyerIsAlexander commented on issue #2081: servicecomb升级至2.1.2版本后,GET接口请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
HoyerIsAlexander commented on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-735046292


   使用@BeanParam注解的request,request里面有个param使用@QueryParam注解,请求直接传递的是uri?queryList=


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



[GitHub] [servicecomb-java-chassis] wujimin commented on issue #2081: servicecomb升级至2.1.2版本后,GET接口请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
wujimin commented on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-734332412


   准确地说,结果是`new String[]{""}`  
   元素个数为1,不是0  
   这符合语义  


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



[GitHub] [servicecomb-java-chassis] HoyerIsAlexander edited a comment on issue #2081: servicecomb升级至2.1.2版本后,GET接口请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
HoyerIsAlexander edited a comment on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-747139925


   之前的1.3.0版本中,这么传值接受是空数组,现在传null包括传一个“”都会认为是new String[]{null}或者new String[]{""},包括Post接口,导致很多兼容性问题,引起了客户投诉,想了解下后续这方面的修改我们在版本升级的时候应该从哪里获取,另外我们是否可以只定义


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



[GitHub] [servicecomb-java-chassis] HoyerIsAlexander commented on issue #2081: servicecomb升级至2.1.2版本后,接口List对象请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
HoyerIsAlexander commented on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-751157641


   好的,那这种修改我们怎么可以知道这个可能被修改了,然后提前通知下客户,也完善下我们的测试用例,毕竟客户的使用方式不太一样,之前可以升级之后不行,客户就认为是问题😂


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



[GitHub] [servicecomb-java-chassis] liubao68 edited a comment on issue #2081: servicecomb升级至2.1.2版本后,GET接口请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
liubao68 edited a comment on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-734162008


   query 为 List 的情况有多种编码形式,默认是 `multi`,  你需要的是那种?
   
   ```
     @Path("queryArrCSV")
     @GET
     public String queryArrCSV(@ApiParam(collectionFormat = "csv") @QueryParam("queryArr") String[] queryArr) {
       return Arrays.toString(queryArr) + queryArr.length;
     }
   
     @Path("queryArrSSV")
     @GET
     public String queryArrSSV(@ApiParam(collectionFormat = "ssv") @QueryParam("queryArr") String[] queryArr) {
       return Arrays.toString(queryArr) + queryArr.length;
     }
   
     @Path("queryArrTSV")
     @GET
     public String queryArrTSV(@ApiParam(collectionFormat = "tsv") @QueryParam("queryArr") String[] queryArr) {
       return Arrays.toString(queryArr) + queryArr.length;
     }
   
     @Path("queryArrPIPES")
     @GET
     public String queryArrPIPES(@ApiParam(collectionFormat = "pipes") @QueryParam("queryArr") String[] queryArr) {
       return Arrays.toString(queryArr) + queryArr.length;
     }
   
     @Path("queryArrMULTI")
     @GET
     public String queryArrMULTI(@ApiParam(collectionFormat = "multi") @QueryParam("queryArr") String[] queryArr) {
       return Arrays.toString(queryArr) + queryArr.length;
     }
   ```
   


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



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2081: servicecomb升级至2.1.2版本后,接口List对象请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-747810659


   哦。 我还看错了。 List<Integer> 确实和 List<String> 不同。 


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



[GitHub] [servicecomb-java-chassis] HoyerIsAlexander commented on issue #2081: servicecomb升级至2.1.2版本后,接口List对象请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
HoyerIsAlexander commented on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-747815527


   恩,可能是我的描述不太准确,这个有修复计划吗?我们需要答复下客户:joy:


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



[GitHub] [servicecomb-java-chassis] HoyerIsAlexander commented on issue #2081: servicecomb升级至2.1.2版本后,接口List对象请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
HoyerIsAlexander commented on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-747170110


   CSE版本:3.1.5 ServiceComb版本:2.1.2 Jackson版本:2.11.0
   
   业务代码:
   
   `
   API接口
   
   public interface ApiInterface {
    QueryRsp query(@Valid QueryParam queryParam);
   }
   
   API实现类
   
   @RestSchema(schemaId = "apiImpl")
   @Path("")
   @Consumes({MediaType.APPLICATION_JSON, MediaType.TEXT_XML})
   @Produces({"application/json; charset=UTF-8", "text/xml; charset=UTF-8"})
   public class ApiImpl {
       @GET
       @Path("/query")
       @Override
       QueryRsp query(@BeanParam QueryParam queryParam) {
       //TODO
       }
   }
   
   QueryParam 
   
   @Data
   public class IncidentLogQueryParam{
       @QueryParam("params")
       private List<@NotNull Integer> params;
   }
   `
   
   浏览器请求:
   
   `http://localhost:8080/query?params=`
   
   结果:
   
   "params:[null]"
   
   
   另外新增Post接口
   
   业务代码:
   `Param  private List<String> params`
   
   请求参数:
   `{
   params: ''
    }`
   
   结果:
   
   "params:[""]"
   
   


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



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2081: servicecomb升级至2.1.2版本后,接口List对象请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-748977843


   这个只能算是老版本的 bug 哦。 目前看现在的行为是符合通用认知的。 `List<Integer> ints = List.of(null)`。 


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



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2081: servicecomb升级至2.1.2版本后,接口List对象请求参数设置值方式修改

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2081:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2081#issuecomment-751169164


   这个只能靠你们增加测试用例了。发现问题了,就加上测试用例。 就像前面给你回复的内容一样, java-chassis加了一些测试。 
   
   这类问题要么不发生,发生了上下游一起配合往前走才是解决问题的办法。


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