Jackson is ignoring spring.jackson.properties in my spring boot application

后端 未结 6 1246
没有蜡笔的小新
没有蜡笔的小新 2021-02-19 06:01

Jackson is ignoring spring.jackson.property-naming-strategy=SNAKE_CASE. I am using springBootVersion 1.4.2.RELEASE. In my application.properties file, I have added

6条回答
  •  闹比i
    闹比i (楼主)
    2021-02-19 06:54

    According to the doc

    /**
     * One of the constants on Jackson's PropertyNamingStrategy
     * (CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES). Can also be a fully-qualified class
     * name of a PropertyNamingStrategy subclass.
     */
    private String propertyNamingStrategy;
    

    You can config it in "application.properties" with this:

    spring.jackson.property-naming-strategy=com.fasterxml.jackson.databind.PropertyNamingStrategy.SnakeCaseStrategy
    

提交回复
热议问题