title: Configure Jackson to use SNAKE_CASE "globally" in Spring Boot 2.0.0.M1
body: <p>I'm using Spring Boot <code>2.0.0.M1</code> (hence Spring <code>5.0.0.RC1</code>). I'm trying to configure it to make use of <code>PropertyNamingStrategy.SnakeCaseStrategy.SNAKE_CASE</code> but I doesn't work so far.</p>
  
  <p>I've tried:</p>
  
  <ol>
  <li><p>The <code>application.yml</code> file with:</p>
  
  <pre><code>spring:
    jackson:
      property-naming-strategy: SNAKE_CASE
  </code></pre></li>
  <li><p>Configuring a <code>Jackson2ObjectMapperBuilder</code> bean:</p>
  
  <pre><code>@Bean
  @Primary
  open fun jacksonBuilder(): Jackson2ObjectMapperBuilder {
    val jacksonMapperBuilder = Jackson2ObjectMapperBuilder()
        .failOnUnknownProperties(false)
        .modules(JavaTimeModule(), KotlinModule())
        .propertyNamingStrategy(PropertyNamingStrategy.SnakeCaseStrategy.SNAKE_CASE)
    logger.info { "Jackson2ObjectMapperBuilder configured successfully..." }
    return jacksonMapperBuilder
  }
  </code></pre></li>
  <li><p>Configuring an <code>ObjectMapper</code> bean:</p>
  
  <pre><code>@Bean
  @Primary
  open fun objectMapper(): ObjectMapper {
    val objectMapper = ObjectMapper()
    objectMapper.registerModule(JavaTimeModule())
    objectMapper.registerModule(KotlinModule())
    objectMapper.setPropertyNamingStrategy(PropertyNamingStrategy.SnakeCaseStrategy.SNAKE_CASE)
    logger.info { "ObjectMapper configured successfully..." }
    return objectMapper
  }
  </code></pre></li>
  </ol>
  
  <p>The only way I've found to make it work it by annotating every single class with <code>@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy::class)</code>...but that's not a solution for my case.</p>
  
  <p>Any other options?</p>
  
  <hr>
  
  <p>This is the <code>dependencies</code> "section" in my <code>build.gradle.kts</code> file:</p>
  
  <pre><code>dependencies {
    compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
    compile("com.fasterxml.jackson.module:jackson-module-kotlin")
    compile("io.github.microutils:kotlin-logging:1.4.4")
    //compile("io.projectreactor:reactor-kotlin-extensions")
    compile("org.springframework.boot:spring-boot-starter-actuator")
    compile("org.springframework.boot:spring-boot-starter-data-mongodb-reactive")
    compile("org.springframework.boot:spring-boot-starter-webflux")
    compile(kotlin("stdlib"))
  
    testCompile("io.projectreactor.addons:reactor-test")
    testCompile("org.springframework.boot:spring-boot-starter-test")
  }
  </code></pre>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>This was indeed fixed on <code>M3</code>; if you need the <code>SnakeCaseStrategy.SNAKE_CASE</code> the setting(s) in <code>application.yml</code> are enough.</p>