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 2021/04/16 08:46:08 UTC

[GitHub] [servicecomb-java-chassis] G-Jay-R opened a new issue #2351: 由补丁版本1.3.0升级到2.1.5:当yaml参数定义为string时,传入参数为json串(Obeject对象)时,接口报400

G-Jay-R opened a new issue #2351:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2351


   2021-04-16 08:43:41,589 ERROR [][][group1-2-thread-17][rest.codec.RestCodec 75] Parameter is not valid for operation [CSBBillingProcessService.RestfulService.batchUsageRating]. Parameter is [parameter]. Processor is [body]. Add servicecomb.codec.printErrorMessage=true to print the details.
   2021-04-16 08:43:41,625 ERROR [][][group1-2-thread-17][common.rest.AbstractRestInvocation 221] unknown rest exception.
   org.apache.servicecomb.swagger.invocation.exception.InvocationException: InvocationException: code=400;msg=CommonExceptionData [message=Parameter is not valid for operation [CSBBillingProcessService.RestfulService.batchUsageRating]. Parameter is [parameter]. Processor is [body].]
           at org.apache.servicecomb.common.rest.codec.RestCodec.restToArgs(RestCodec.java:77) ~[common-rest-2.1.5.jar:2.1.5]
           at org.apache.servicecomb.common.rest.filter.inner.ServerRestArgsFilter.afterReceiveRequest(ServerRestArgsFilter.java:62) ~[common-rest-2.1.5.jar:2.1.5]
           at org.apache.servicecomb.common.rest.AbstractRestInvocation.prepareInvoke(AbstractRestInvocation.java:233) ~[common-rest-2.1.5.jar:2.1.5]
           at org.apache.servicecomb.common.rest.AbstractRestInvocation.invoke(AbstractRestInvocation.java:213) ~[common-rest-2.1.5.jar:2.1.5]
           at org.apache.servicecomb.common.rest.AbstractRestInvocation.runOnExecutor(AbstractRestInvocation.java:203) ~[common-rest-2.1.5.jar:2.1.5]
           at org.apache.servicecomb.common.rest.AbstractRestInvocation.lambda$scheduleInvocation$0(AbstractRestInvocation.java:162) ~[common-rest-2.1.5.jar:2.1.5]
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_262]
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_262]
           at java.lang.Thread.run(Thread.java:748) [?:1.8.0_262]


-- 
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] G-Jay-R commented on issue #2351: 由补丁版本1.3.0升级到2.1.5:当yaml参数定义为string时,传入参数为json串(Obeject对象)时,接口报400

Posted by GitBox <gi...@apache.org>.
G-Jay-R commented on issue #2351:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2351#issuecomment-826184246


   delete:         |调用样例:https://{BASE-URL}/{id}|'
   之前还有过一个这样子的兼容,请求参数在path下,比如这个id,定义为必选,如果传的时候不填值,之前的版本是可以进到方法里的,我们在方法里做了非空检验,但是最新的版本是直接拦截在框架外了,进不到方法里了是么?


-- 
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] G-Jay-R commented on issue #2351: 由补丁版本1.3.0升级到2.1.5:当yaml参数定义为string时,传入参数为json串(Obeject对象)时,接口报400

Posted by GitBox <gi...@apache.org>.
G-Jay-R commented on issue #2351:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2351#issuecomment-828103718


   好的,我们再参考指导弄一下~


-- 
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 #2351: 由补丁版本1.3.0升级到2.1.5:当yaml参数定义为string时,传入参数为json串(Obeject对象)时,接口报400

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


   这种用法看起来是错误的。 String类型和Object类型的json序列化结果是不一样的。Object的序列化结果无法序列化为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 #2351: 由补丁版本1.3.0升级到2.1.5:当yaml参数定义为string时,传入参数为json串(Obeject对象)时,接口报400

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


   这个感觉以前的做法也是bug哦。 比如系统中定义了两个接口:
   
   ```
   delete /api/foo/{id}
   delete /api/foo
   ```
   
   请求 /api/foo 的时候, 不应该走到 /api/foo/{id}
   
   如果需要表达请求到接口的语义,需要使用
   
   ```
   delete /api/foo/{path: .+}
   ```
   
   参考: https://github.com/apache/servicecomb-java-chassis/issues/2329


-- 
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] kaister3 edited a comment on issue #2351: 由补丁版本1.3.0升级到2.1.5:当yaml参数定义为string时,传入参数为json串(Obeject对象)时,接口报400

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


   Add servicecomb.codec.printErrorMessage=true to print the details.
   加上这个配置可以打印详细信息。最好附上使用场景。


-- 
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] G-Jay-R removed a comment on issue #2351: 由补丁版本1.3.0升级到2.1.5:当yaml参数定义为string时,传入参数为json串(Obeject对象)时,接口报400

Posted by GitBox <gi...@apache.org>.
G-Jay-R removed a comment on issue #2351:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2351#issuecomment-821783742


   Add servicecomb.codec.printErrorMessage  -- 这个是在microservice.yaml里面定义么?


-- 
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 #2351: 由补丁版本1.3.0升级到2.1.5:当yaml参数定义为string时,传入参数为json串(Obeject对象)时,接口报400

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


   对于服务端定义接口使用String,但是客户端期望传递json, 服务端能够接收的代码写法参考: https://docs.servicecomb.io/java-chassis/zh_CN/build-provider/springmvc/  “指定 String 类型 body 编码方式” 章节


-- 
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 #2351: 由补丁版本1.3.0升级到2.1.5:当yaml参数定义为string时,传入参数为json串(Obeject对象)时,接口报400

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






-- 
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] G-Jay-R commented on issue #2351: 由补丁版本1.3.0升级到2.1.5:当yaml参数定义为string时,传入参数为json串(Obeject对象)时,接口报400

Posted by GitBox <gi...@apache.org>.
G-Jay-R commented on issue #2351:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2351#issuecomment-821783742


   Add servicecomb.codec.printErrorMessage  -- 这个是在microservice.yaml里面定义么?


-- 
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] G-Jay-R commented on issue #2351: 由补丁版本1.3.0升级到2.1.5:当yaml参数定义为string时,传入参数为json串(Obeject对象)时,接口报400

Posted by GitBox <gi...@apache.org>.
G-Jay-R commented on issue #2351:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2351#issuecomment-826184246


   delete:         |调用样例:https://{BASE-URL}/{id}|'
   之前还有过一个这样子的兼容,请求参数在path下,比如这个id,定义为必选,如果传的时候不填值,之前的版本是可以进到方法里的,我们在方法里做了非空检验,但是最新的版本是直接拦截在框架外了,进不到方法里了是么?


-- 
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 #2351: 由补丁版本1.3.0升级到2.1.5:当yaml参数定义为string时,传入参数为json串(Obeject对象)时,接口报400

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


   这个感觉以前的做法也是bug哦。 比如系统中定义了两个接口:
   
   ```
   delete /api/foo/{id}
   delete /api/foo
   ```
   
   请求 /api/foo 的时候, 不应该走到 /api/foo/{id}
   
   如果需要表达请求到接口的语义,需要使用
   
   ```
   delete /api/foo//{path: .+}
   ```
   
   


-- 
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] G-Jay-R commented on issue #2351: 由补丁版本1.3.0升级到2.1.5:当yaml参数定义为string时,传入参数为json串(Obeject对象)时,接口报400

Posted by GitBox <gi...@apache.org>.
G-Jay-R commented on issue #2351:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2351#issuecomment-821783776


   > Add servicecomb.codec.printErrorMessage=true to print the details.
   > 加上这个配置可以打印详细信息。最好附上使用场景。
   
   - 这个是在microservice.yaml里面定义么?


-- 
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 #2351: 由补丁版本1.3.0升级到2.1.5:当yaml参数定义为string时,传入参数为json串(Obeject对象)时,接口报400

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


   这个感觉以前的做法也是bug哦。 比如系统中定义了两个接口:
   
   ```
   delete /api/foo/{id}
   delete /api/foo
   ```
   
   请求 /api/foo 的时候, 不应该走到 /api/foo/{id}
   
   如果需要表达请求到接口的语义,需要使用
   
   ```
   delete /api/foo/{path: .+}
   ```
   
   


-- 
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] G-Jay-R commented on issue #2351: 由补丁版本1.3.0升级到2.1.5:当yaml参数定义为string时,传入参数为json串(Obeject对象)时,接口报400

Posted by GitBox <gi...@apache.org>.
G-Jay-R commented on issue #2351:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2351#issuecomment-822287774


   > 这种用法看起来是错误的。 String类型和Object类型的json序列化结果是不一样的。Object的序列化结果无法反序列化为String。
   
   
   2.4.x | 1.3.0 | 提供给具体产品的基于 1.3.0 修改的补丁版本,并且合入了2.0.x 的弱类型需求,建议升级到 3.1.5
   
   我们是从2.4.x升级过来的,之前的版本是没问题的呢,我们想知道是新版本不兼容之前的了么?
   


-- 
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 #2351: 由补丁版本1.3.0升级到2.1.5:当yaml参数定义为string时,传入参数为json串(Obeject对象)时,接口报400

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


   这个感觉以前的做法也是bug哦。 比如系统中定义了两个接口:
   
   ```
   delete /api/foo/{id}
   delete /api/foo
   ```
   
   请求 /api/foo 的时候, 不应该走到 /api/foo/{id}
   
   如果需要表达请求到接口的语义,需要使用
   
   ```
   delete /api/foo//{path: .+}
   ```
   
   


-- 
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 #2351: 由补丁版本1.3.0升级到2.1.5:当yaml参数定义为string时,传入参数为json串(Obeject对象)时,接口报400

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


   不考虑具体实现,按照正常的逻辑,这个方式是错误的。这种场景讨论兼容没有意义。因为也会作为bug被修复。 


-- 
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] kaister3 commented on issue #2351: 由补丁版本1.3.0升级到2.1.5:当yaml参数定义为string时,传入参数为json串(Obeject对象)时,接口报400

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


   Add servicecomb.codec.printErrorMessage=true to print the details.


-- 
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 #2351: 由补丁版本1.3.0升级到2.1.5:当yaml参数定义为string时,传入参数为json串(Obeject对象)时,接口报400

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


   这种用法看起来是错误的。 String类型和Object类型的json序列化结果是不一样的。Object的序列化结果无法反序列化为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] kaister3 edited a comment on issue #2351: 由补丁版本1.3.0升级到2.1.5:当yaml参数定义为string时,传入参数为json串(Obeject对象)时,接口报400

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


   Add servicecomb.codec.printErrorMessage=true to print the details.
   加上这个配置可以打印详细信息


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