阿超
>
springboot中jackson的yml配置
生命是短暂的,如果我能让别人以更短的时间,看到更多的美,这难道不是一件值得奋斗的事情吗?——灵遁者
配置如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| spring: jackson: date-format: yyyy-MM-dd HH:mm:ss property-naming-strategy: com.fasterxml.jackson.databind.PropertyNamingStrategy visibility: GETTER: PUBLIC_ONLY SETTER: PUBLIC_ONLY CREATOR: NON_PRIVATE FIELD: PUBLIC_ONLY IS_GETTER: PUBLIC_ONLY NONE: PUBLIC_ONLY ALL: DEFAULT serialization: INDENT_OUTPUT: true deserialization: USE_BIG_DECIMAL_FOR_FLOATS: true mapper: ACCEPT_CASE_INSENSITIVE_PROPERTIES: true parser: ALLOW_UNQUOTED_FIELD_NAMES: true generator: WRITE_BIGDECIMAL_AS_PLAIN: true defaultPropertyInclusion: USE_DEFAULTS timeZone: Asia/Shanghai locale: CHINA
|
关于visibility
的值,可以参考我之前这篇博客:
https://VampireAchao.github.io/2021/04/09/JsonAutoDetect/