Skip to content

Commit

Permalink
fix: webClient codec을 SNAKE_CASE로 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jhhong0509 committed Aug 14, 2022
1 parent 51002ea commit 794b869
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
package com.xquare.v1userservice.configuration.webclient

import com.fasterxml.jackson.databind.ObjectMapper
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.http.codec.ClientCodecConfigurer
import org.springframework.http.codec.json.Jackson2JsonDecoder
import org.springframework.web.reactive.function.client.ExchangeStrategies
import org.springframework.web.reactive.function.client.WebClient


@Configuration
class WebClientConfiguration {
@Bean
fun webClient(): WebClient =
WebClient.builder().build()
fun webClient(objectMapper: ObjectMapper): WebClient =
WebClient.builder()
.exchangeStrategies(ExchangeStrategies.builder()
.codecs { configurer: ClientCodecConfigurer ->
configurer.defaultCodecs().jackson2JsonDecoder(Jackson2JsonDecoder(objectMapper))
}
.build())
.build()
}

0 comments on commit 794b869

Please sign in to comment.