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/01/17 12:06:31 UTC

[GitHub] [servicecomb-java-chassis] youxiaoyouhaha opened a new issue #2699: CSE中使用@JsonProperty不生效

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


   框架版本:nuwa+cse 依赖的cse版本是1.3.2
   如果在返回的实体类中加上@JsonProperty注解,则不会生效,求原因
   
   例如:
       @Valid
       @JsonProperty("OperationDetailList")
       @NoFuzzy
       private List<OperationDetail> operationDetailList = new ArrayList<OperationDetail>();
   返回:
    "operationDetailList": [
                       {
                           "changeItem": "t_targeting.targeting_id",
                           "before": "",
                           "after": "65261562"
                       }]
   
   


-- 
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] lbc97 edited a comment on issue #2699: CSE中使用@JsonProperty不生效

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


   已根据描述做出相应场景demo,结论是Servicecomb可以使用@JsonProperty,经过走读源码发现,该注解是直接作用在类的属性上,可以根据这一点来排查一下是否在业务中用了中间容器处理。走读源码可以在java.lang.reflect类中public Annotation[] getDeclaredAnnotations()方法中打上断点调试。


-- 
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] develpoerX commented on issue #2699: CSE中使用@JsonProperty不生效

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


   > 这个问题的原因是swagger的版本问题,我们用的servicecomb版本是1.3.2里面引用的swagger版本是1.5.22,解决方法是:排除CSE自身依赖的swagger,单独进行引用swagger1.6.2版本,并进行指明:nuwa.system.classloader.usebiz.nuwa-cse-foundation=com.fasterxml.jackson._,io.swagger.jackson._
   
   我记得之前升级jackson版本时,就遇到预先升级swagger。新版本的swagger的ID已经变更了。业务自行升级jackson,就需要考虑swagger的配套版本。


-- 
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 #2699: CSE中使用@JsonProperty不生效

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


   能基于 https://github.com/apache/servicecomb-samples/tree/master/java-chassis-samples 提供一个例子吗? 
   
   https://github.com/apache/servicecomb-java-chassis/blob/master/demo/demo-schema/src/main/java/org/apache/servicecomb/demo/model/SpecialNameModel.java 有个测试用例, 看起来是可以的。 


-- 
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] youxiaoyouhaha commented on issue #2699: CSE中使用@JsonProperty不生效

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


   这个问题的原因是swagger的版本问题,我们用的servicecomb版本是1.3.2里面引用的swagger版本是1.5.22,解决方法是:排除CSE自身依赖的swagger,单独进行引用swagger1.6.2版本,并进行指明:nuwa.system.classloader.usebiz.nuwa-cse-foundation=com.fasterxml.jackson.*,io.swagger.jackson.*


-- 
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 #2699: CSE中使用@JsonProperty不生效

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


   据说是jackson版本导致的问题,业务引入的三方件不兼容。 


-- 
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] youxiaoyouhaha commented on issue #2699: CSE中使用@JsonProperty不生效

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


   这个问题的原因是swagger的版本问题,我们用的servicecomb版本是1.3.2里面引用的swagger版本是1.5.22,解决方法是:排除CSE自身依赖的swagger,单独进行引用swagger1.6.2版本,并进行指明:nuwa.system.classloader.usebiz.nuwa-cse-foundation=com.fasterxml.jackson.*,io.swagger.jackson.*


-- 
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] lbc97 commented on issue #2699: CSE中使用@JsonProperty不生效

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


   已根据描述做出相应场景demo,Servicecomb可以使用@JsonProperty,经过走读源码发现,该注解是直接作用在类的属性上,可以根据这一点来排查一下是否在业务中用了中间容器处理。走读源码可以在java.lang.reflect类中public Annotation[] getDeclaredAnnotations()方法中打上断点调试。


-- 
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] lbc97 commented on issue #2699: CSE中使用@JsonProperty不生效

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


   servicecomb2.6.0已经引入jackson2.12.1不需要引入第三方了,而且如果再引入第三方应该会报错导致程序启动失败


-- 
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] lbc97 commented on issue #2699: CSE中使用@JsonProperty不生效

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


   servicecomb2.6.0已经引入jackson2.12.1不需要引入第三方了,而且如果再引入第三方应该会报错导致程序启动失败


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