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 2022/03/15 02:33:19 UTC

[GitHub] [servicecomb-java-chassis] lengshanwudi opened a new issue #2735: 使用@path@post注解时,请求参数中存在Boolean类型时会把Boolean类型识别为Body

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


   bool值isSync、isGray定义在IntentRequestHeaders 实体类中
   ```
       public CompletableFuture<xxxx> executeSkill(
           @BeanParam @NotNull IntentRequestHeaders intentRequestHeaders,
           @RequestBody @NotNull IntentRequest intentRequest) {}
   ```
   ```
   @HeaderParam("x-is-sync")
     private Boolean isSync;
     @HeaderParam("x-is-gray")
     private Boolean isGray;
   ```
   
   报错信息:
   _java.lang.IllegalStateException: defined 3 body parameter.
   	at org.apache.servicecomb.swagger.generator.core.AbstractOperationGenerator.initParameterGenerators(AbstractOperationGenerator.java:222)
   	at org.apache.servicecomb.swagger.generator.core.AbstractOperationGenerator.scanMethodParameters(AbstractOperationGenerator.java:192)
   	at org.apache.servicecomb.swagger.generator.core.AbstractOperationGenerator.generate(AbstractOperationGenerator.java:152)
   	at org.apache.servicecomb.swagger.generator.core.AbstractSwaggerGenerator.scanMethods(AbstractSwaggerGenerator.java:297)_


-- 
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-unsubscribe@servicecomb.apache.org

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



[GitHub] [servicecomb-java-chassis] zhaozw commented on issue #2735: 使用@path@post注解时,请求参数中存在Boolean类型时会把Boolean类型识别为Body

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


   Boolean 类型的名字不要加is,直接sync和gray,否则会有问题,通过反射找不到对应的变量


-- 
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-unsubscribe@servicecomb.apache.org

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



[GitHub] [servicecomb-java-chassis] liubao68 removed a comment on issue #2735: 使用@path@post注解时,请求参数中存在Boolean类型时会把Boolean类型识别为Body

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


   ```
   @HeaderParam("x-is-sync")
     private Boolean isSync;
     @HeaderParam("x-is-gray")
     private Boolean isGray;
   ```
   
   是 IntentRequest  的属性吗?


-- 
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-unsubscribe@servicecomb.apache.org

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



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2735: 使用@path@post注解时,请求参数中存在Boolean类型时会把Boolean类型识别为Body

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


   ```
   @HeaderParam("x-is-sync")
     private Boolean isSync;
     @HeaderParam("x-is-gray")
     private Boolean isGray;
   ```
   
   是 IntentRequest  的属性吗?


-- 
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-unsubscribe@servicecomb.apache.org

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



[GitHub] [servicecomb-java-chassis] zhaozw edited a comment on issue #2735: 使用@path@post注解时,请求参数中存在Boolean类型时会把Boolean类型识别为Body

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


   Boolean 类型的名字不要加is,直接sync和gray,否则会有问题,isSync会去查找sync,通过反射找不到对应的变量,也就找不到对应的注解。


-- 
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-unsubscribe@servicecomb.apache.org

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