JedrekWang opened a new issue, #4303:
URL: https://github.com/apache/servicecomb-java-chassis/issues/4303

   #### 背景
   ServerRestArgsFilter对于文件下载的接口的判断逻辑进行了调整
   1.x 逻辑如下
   ```java
       if (Part.class.isInstance(body)) {
         return responseEx.sendPart((Part) body);
       }
   ```
   
   2.8.x逻辑如下
   ```java
   Part.class.isAssignableFrom(
           invocation.findResponseType(response.getStatusCode()).getRawClass());
   ```
   业务使用场景如下:
   
当文件下载接口出现错误时,会将异常信息统一处理为通用的{“errorCode”:"xxx","errorDesc"."xxx"}的json结构体,使用1.x场景的判断逻辑不是part类型,所以按照正常的json处理不存在问题,但是使用2.8.x的判断逻辑,从契约中查询接口返回类型为part类型,但是实际为json,导致类型转换不一样报错java.lang.IllegalStateException:
 File input parameter of null could be javax.servlet.http.Part / 
java.io.InputStream / org.springframework.core.io.Resource / byte[] or 
java.io.File, but got xxx
   
   #### 诉求
   因为业务的接口已经开放出去了,接口调用方依赖返回的错误码来进行额外的操作,需要servicecomb能够考虑兼容此种场景


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

To unsubscribe, e-mail: commits-unsubscr...@servicecomb.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to