DEFAULT_VIEW_INCLUSION如何在 Spring中将属性设置为yml文件?
现在,我有这个
spring:
jackson:
mapper:
DEFAULT_VIEW_INCLUSION: true
但不起作用。
尝试使用 Java 配置:
@Configuration
public class JacksonMapperConfig {
@Bean
public ObjectMapper objectMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(MapperFeature.DEFAULT_VIEW_INCLUSION, true);
return mapper;
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4564 次 |
| 最近记录: |