java - Spring boot 配置spring.jackson.serialization-inclusion无效

 阴森森林蛀 发布于 2022-10-26 02:47

在学习spring boot时配置Jackson遇到一个配置spring.jackson.serialization-inclusion无效,配置在一起的date-format是有效的,查了一大圈资料,感觉应该可以才对!

github上的问题链接:https://github.com/spring-pro...

参照github上配的,spring boot是 1.5.1版本,不知道为什么不起作用,项目中的配置:

     
 #Jackson配置
spring.jackson: 
  serialization-inclusion: non_null
  date-format: yyyy/MM/dd HH:mm:ss

界面的输出:

{
    "color": "#1e90ff",
    "color0": null,
    "type": "dashed",
    "width": 2,
    "shadowColor": null,
    "shadowBlur": null,
    "shadowOffsetX": null,
    "shadowOffsetY": null,
    "normal": null,
    "emphasis": null
}

##这是另一个例子
{"id":1,"email":null,"name":"jack","birth":"2017/02/28 14:43:00"}
1 个回答
  • 配置 spring.jackson.default-property-inclusion

    2022-10-27 00:37 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有