在YAML文件中设置DEFAULT_VIEW_INCLUSION对MapperFeature不起作用.DEFAULT_VIEW_INCLUSION

问题描述 投票:0回答:1

我在spring boot yaml文件中设置了以下内容。但不行。我检查了问题Set DEFAULT_VIEW_INCLUSION in YAML file。但是他们已经给出了新的自定义objectmapper对象的答案,但没有使用spring convertor对象。

spring:jackson:mapper:DEFAULT_VIEW_INCLUSION:true

spring-boot jackson spring-rest objectmapper json-view
1个回答
0
投票

请尝试以下配置:

spring:
    jackson:
        default-property-inclusion: DEFAULT_VIEW_INCLUSION
© www.soinside.com 2019 - 2024. All rights reserved.