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/03/04 09:42:31 UTC

[GitHub] [servicecomb-java-chassis] lengshanwudi opened a new issue #2276: CSE是否有全局配置,可以在接口序列化时控制接口返回null的显示,将为null的字段不返回给客户端?

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


   file:///C:/Users/n00346256/AppData/Roaming/eSpace_Desktop/UserData/n00346256/imagefiles/28DC589B-C777-4B3E-8780-AF296E7AE734.png
   如上图,期望不返回directives和cp 两个字段


----------------------------------------------------------------
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] lengshanwudi commented on issue #2276: CSE是否有全局配置,可以在接口序列化时控制接口返回null的显示,将为null的字段不返回给客户端?

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


   Thanks A Million!!! 👍 👍 👍 


----------------------------------------------------------------
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] kissLife commented on issue #2276: CSE是否有全局配置,可以在接口序列化时控制接口返回null的显示,将为null的字段不返回给客户端?

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


   RestObjectMapperFactory.getRestObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL);


----------------------------------------------------------------
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] yhs0092 commented on issue #2276: CSE是否有全局配置,可以在接口序列化时控制接口返回null的显示,将为null的字段不返回给客户端?

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


   可以通过定制Jackson ObjectMapper的行为来实现。Java-Chassis也是通过ObjectMapper来做参数序列化和反序列化的。
   
   Java-Chassis实际使用的是`org.apache.servicecomb.common.rest.codec.RestObjectMapper`,ObjectMapper的子类,保存在`org.apache.servicecomb.common.rest.codec.RestObjectMapperFactory`工厂中。


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