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 2019/05/24 03:11:50 UTC

[GitHub] [servicecomb-java-chassis] dongzegithub opened a new issue #1218: rest请求参数有继承时无法获取父类参数内容

dongzegithub opened a new issue #1218:  rest请求参数有继承时无法获取父类参数内容
URL: https://github.com/apache/servicecomb-java-chassis/issues/1218
 
 
   ###  rest请求参数有继承时无法获取父类参数内容
   ##### 请求参数类TestAReq 继承TestBReq
   ```java
   @Data
   @EqualsAndHashCode(callSuper = false)
   public class TestAReq extends TestBReq
   {
       @QueryParam("tempC")
       private String tempC; 
       
       @QueryParam("tempD")
       private String tempD; 
   }
   ```
   ```java
   public class TestBReq
   {
       @QueryParam("tempA")
       private String tempA; 
       
       @QueryParam("tempB")
       private String tempB; 
   }
   ```
   
   ##### 在rest请求queryTest中使用TestAReq作为请求参数,在传参之后,TestAReq中的tempA、tempB的值为null
   ```java
       @GET
       @Path("")
       @Consumes({MediaType.APPLICATION_JSON, MediaType.TEXT_XML})
       @Produces({"application/json; charset=UTF-8", "text/xml; charset=UTF-8"})
       public TestRsp queryTest(
               @BeanParam TestAReq request)
       {
           return XXXX;
       }
   
   ```

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


With regards,
Apache Git Services